ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
SuffixSorting.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*-------------------------- File SuffixSorting.h --------------------------*/
3/*--------------------------------------------------------------------------*/
189/*--------------------------------------------------------------------------*/
190/*----------------------------- DEFINITIONS --------------------------------*/
191/*--------------------------------------------------------------------------*/
192
193#ifndef __ADS_SuffixSorting
194 #define __ADS_SuffixSorting
195/* self-identification: #endif constant */
196
197/*--------------------------------------------------------------------------*/
198/*------------------------------ INCLUDES ----------------------------------*/
199/*--------------------------------------------------------------------------*/
200
201#include "ADS/Contract.h"
202#include "ADS/Portable.h"
203#include "ADS/memory/Prefetch.h"
204
205#include <concepts>
206#include <cstddef>
207#include <cstdint>
208#include <string_view>
209#include <vector>
210
211/*--------------------------------------------------------------------------*/
212/*--------------------------- NAMESPACE ------------------------------------*/
213/*--------------------------------------------------------------------------*/
214
215namespace ADS
216{
217
256template< class I = std::uint32_t >
257 requires( std::same_as< I , std::uint32_t > ||
258 std::same_as< I , std::uint64_t > )
259[[nodiscard]] std::vector< I > suffixArray( std::string_view T );
260
277template< class I >
278 requires( std::same_as< I , std::uint32_t > ||
279 std::same_as< I , std::uint64_t > )
280[[nodiscard]] std::vector< I > suffixArray( const std::vector< I > & T ,
281 std::size_t K );
282
308template< class I >
309[[nodiscard]] std::vector< I > plcpArray( std::string_view T ,
310 const std::vector< I > & SA );
311
331template< class I >
332[[nodiscard]] std::vector< I > lcpArrayPhi( std::string_view T ,
333 const std::vector< I > & SA );
334
335/*--------------------------------------------------------------------------*/
336
337} // end( namespace ADS )
338
339/*--------------------------------------------------------------------------*/
340/*-------------------------- IMPLEMENTATION --------------------------------*/
341/*--------------------------------------------------------------------------*/
342
343#include "ADS/string/impl/SuffixSorting.tpp"
344
345/*--------------------------------------------------------------------------*/
346
347#endif /* SuffixSorting.h included */
348
349/*--------------------------------------------------------------------------*/
350/*------------------------ End File SuffixSorting.h ------------------------*/
351/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The primitives of the processor that the compilers spell each in their own way, in one form for all: ...
The prefetch of a line of the cache, beyond the book: ADS::prefetch( p ) asks the processor to bring ...
std::vector< I > lcpArrayPhi(E &ex, std::string_view T, const std::vector< I > &SA)
the LCP array of the text of bytes and of its suffix array of indices of the type I,...
Definition ParallelText.h:205
std::vector< I > plcpArray(std::string_view T, const std::vector< I > &SA)
the permuted LCP array: is the lcp of the suffix and the one before it in (0 for the first)
std::vector< I > suffixArray(std::string_view T)
the suffix array of the bytes of , by SA-IS on integers I (32 or 64 bits, unsigned)
Definition ADT.h:96