Factor Oracle state class. More...
#include <Oracle_classes.hpp>
Protected Attributes | |
int | statenb |
Number of the state in FO. | |
list< O_state * > | trans |
List of transitions of the state. | |
pair< O_state *, int > | suff |
Suffix link of the state. | |
list< pair< O_state *, int > > | rsuff |
List of reverse suffix links of the state. | |
Public Member Functions | |
Constructors & Destructors | |
O_state () | |
Default constructor. | |
O_state (int) | |
Create a state with its number. | |
O_state (const O_state &) | |
Copy constructor. | |
~O_state () | |
Standard destructor. | |
Set & Get | |
int | get_statenb () |
Return the number of the state in FO. | |
void | set_statenb (int) |
Set the number of the state in FO. | |
list< O_state * > | get_trans () |
Return the list transitions. | |
pair< O_state *, int > | get_suffix () |
Return the suffix link and the associated lrs. | |
void | set_suffix (O_state *, int) |
Set the suffix link and associated lrs. | |
list< pair< O_state *, int > > | get_rsuff () |
Return the list of reverse suffix links. | |
Transitions & Suffixes | |
void | add_trans (O_state *) |
Add a transition to the transition list. | |
void | add_rsuff (const pair< O_state *, int > &rsuffin) |
Add a link to the reverse suffix links list. | |
Suffix Tree Functions | |
O_state * | rec_upSLT (list< O_state * > *, int=0) |
Recursive function to follow suffix links. | |
list< pair< O_state *, int > > * | rec_downSLT (list< pair< O_state *, int > > *, int=0) |
Recursive function to follow reverse suffix links. | |
list< pair< O_state *, int > > * | rec_sortSLT (list< pair< O_state *, int > > *, int=0, int=INT_MAX) |
Recursive function to list & sort nodes in a subSLT. | |
list< pair< O_state *, int > > * | sortedSLT (int=0, int=INT_MAX) |
Function to collect and sort all jump candidates from a state. | |
Friends | |
Operators Overload | |
ostream & | operator<< (ostream &, O_state &) |
Output the attributes of the state on a standard stream. |
Factor Oracle state class.
This class implements the basic structure of an Factor Oracle state with transitions, suffix link and reverse suffix links. The Length of Repeated Suffix (lrs) is the length of the common suffix between both ends of a link.
Definition at line 27 of file Oracle_classes.hpp.
list<pair<O_state*,int> > O_state::rsuff [protected] |
List of reverse suffix links of the state.
That a list of every suffix link pointing to the state with their origin and lrs.
Definition at line 40 of file Oracle_classes.hpp.
pair<O_state*,int> O_state::suff [protected] |
Suffix link of the state.
The first element of the pair is the destination of the link, the second element is the lrs.
Definition at line 37 of file Oracle_classes.hpp.
list<O_state*> O_state::trans [protected] |
List of transitions of the state.
Each pointer in the list represents a transition from the state to the pointed state.
Definition at line 34 of file Oracle_classes.hpp.
O_state::O_state | ( | ) |
Default constructor.
Definition at line 12 of file Oracle_classes.cpp.
O_state::O_state | ( | int | nb | ) |
Create a state with its number.
Definition at line 20 of file Oracle_classes.cpp.
Return the list of reverse suffix links.
Definition at line 63 of file Oracle_classes.cpp.
list< O_state * > O_state::get_trans | ( | ) |
Return the list transitions.
Definition at line 46 of file Oracle_classes.cpp.
list< pair< O_state *, int > > * O_state::rec_downSLT | ( | list< pair< O_state *, int > > * | SLTlist, | |
int | ctxtmin = 0 | |||
) |
Recursive function to follow reverse suffix links.
Starting from the current state, this function recursively follows reverse suffix links. It pushes on the froont of the list SLTlist every state it visited. Reverse suffix links are visited if lrs<ctxtmin. Recursion stops when every link has been followed.
SLTlist | A pointer to an empy list of pairs of state reference and lrs to push every state along the path | |
ctxtmin | A minimal context (lrs) to select reverse suffix links (default is 0 and the algorithm visites all the states of FO). |
Definition at line 101 of file Oracle_classes.cpp.
list< pair< O_state *, int > > * O_state::rec_sortSLT | ( | list< pair< O_state *, int > > * | SLTlist, | |
int | ctxtmin = 0 , |
|||
int | ctxt = INT_MAX | |||
) |
Recursive function to list & sort nodes in a subSLT.
SLTlist | A pointer to a list of pairs of state reference and lrs to push every state along the path | |
ctxtmin | A minimal context (lrs) to select reverse suffix links (default is 0 and the algorithm visites all the states of FO). |
Definition at line 119 of file Oracle_classes.cpp.
Recursive function to follow suffix links.
Starting from the current state, this function recursively follows suffix links. It pushes on the front of the list path every state it visited. Recursion stops when a suffix link with an lrs<ctxtmin is encounterd.
path | A pointer to an empty list of state references to push the path of suffix links | |
ctxtmin | A minimal context (lrs) to stop the recursion (default is 0 and the recursion goes to the very first state of FO). |
Definition at line 85 of file Oracle_classes.cpp.
Function to collect and sort all jump candidates from a state.
ctxtmin | A minimal context (lrs) to select reverse suffix links (default is 0 and the algorithm visites all the states of FO). | |
nbMaxSol | A maximal number of solution to collect (default is INT_MAX and the algorithm collects all the solutions) |
Definition at line 141 of file Oracle_classes.cpp.