ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
Lyndon.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*----------------------------- File Lyndon.h ------------------------------*/
3
/*--------------------------------------------------------------------------*/
47
/*--------------------------------------------------------------------------*/
48
/*----------------------------- DEFINITIONS --------------------------------*/
49
/*--------------------------------------------------------------------------*/
50
51
#ifndef __ADS_Lyndon
52
#define __ADS_Lyndon
53
/* self-identification: #endif constant */
54
55
/*--------------------------------------------------------------------------*/
56
/*------------------------------ INCLUDES ----------------------------------*/
57
/*--------------------------------------------------------------------------*/
58
59
#include "
ADS/Contract.h
"
60
61
#include <cstddef>
62
#include <string_view>
63
#include <vector>
64
65
/*--------------------------------------------------------------------------*/
66
/*--------------------------- NAMESPACE ------------------------------------*/
67
/*--------------------------------------------------------------------------*/
68
69
namespace
ADS
70
{
71
74
[[nodiscard]]
inline
bool
isLyndon
( std::string_view S );
75
99
[[nodiscard]]
inline
std::vector< std::size_t >
100
lyndonFactorization
( std::string_view S );
101
120
[[nodiscard]]
inline
std::size_t
leastRotation
( std::string_view S );
121
122
/*--------------------------------------------------------------------------*/
123
124
}
// end( namespace ADS )
125
126
/*--------------------------------------------------------------------------*/
127
/*-------------------------- IMPLEMENTATION --------------------------------*/
128
/*--------------------------------------------------------------------------*/
129
130
#include "ADS/string/impl/Lyndon.tpp"
131
132
/*--------------------------------------------------------------------------*/
133
134
#endif
/* Lyndon.h included */
135
136
/*--------------------------------------------------------------------------*/
137
/*--------------------------- End File Lyndon.h ----------------------------*/
138
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::lyndonFactorization
std::vector< std::size_t > lyndonFactorization(std::string_view S)
the starts of the factors of the Lyndon factorization of , by Duval
ADS::isLyndon
bool isLyndon(std::string_view S)
whether is a Lyndon word, i.e., nonempty and smaller than all its proper suffixes,...
ADS::leastRotation
std::size_t leastRotation(std::string_view S)
the start of the least rotation of , 0 if is empty
ADS
Definition
ADT.h:96
ADS
string
Lyndon.h
Generated by
1.17.0