Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Tree structure represented as linear sequece as result of preorder traversal with additional bar symbols. The representation is so called ranked, therefore it consists of ranked symbols (bars are ranked as well). The rank of the ranked symbol needs to be compatible with unsigned integer. More...
#include <PrefixRankedBarTree.h>
Public Member Functions | |
PrefixRankedBarTree (ext::set< common::ranked_symbol< SymbolType > > bars, ext::set< common::ranked_symbol< SymbolType > > alphabet, ext::vector< common::ranked_symbol< SymbolType > > data) | |
Creates a new instance of the tree with concrete alphabet, bars, and content. More... | |
PrefixRankedBarTree (ext::set< common::ranked_symbol< SymbolType > > bars, ext::vector< common::ranked_symbol< SymbolType > > data) | |
Creates a new instance of the tree based on the content and bar set, the alphabet is implicitly created from the content. More... | |
PrefixRankedBarTree (SymbolType barBase, const RankedTree< SymbolType > &tree) | |
Creates a new instance of the tree based on the RankedTree. The linear representation is constructed (including bars) by preorder traversal on the tree parameter. Symbol part of bars is provided as a parameter. More... | |
PrefixRankedBarTree (const RankedTree< > &tree) | |
Creates a new instance of the tree based on the RankedTree. The linear representation is constructed (including bars) by preorder traversal on the tree parameter. Bar symbols are created using some default value. More... | |
const ext::set< common::ranked_symbol< SymbolType > > & | getAlphabet () const & |
ext::set< common::ranked_symbol< SymbolType > > && | getAlphabet () && |
void | extendAlphabet (const ext::set< common::ranked_symbol< SymbolType > > &symbols) |
const ext::set< common::ranked_symbol< SymbolType > > & | getBars () const & |
ext::set< common::ranked_symbol< SymbolType > > && | getBars () && |
void | extendBars (const ext::set< common::ranked_symbol< SymbolType > > &bars) |
const ext::vector< common::ranked_symbol< SymbolType > > & | getContent () const & |
ext::vector< common::ranked_symbol< SymbolType > > && | getContent () && |
void | setContent (ext::vector< common::ranked_symbol< SymbolType > > data) |
bool | isEmpty () const |
auto | operator<=> (const PrefixRankedBarTree &other) const |
bool | operator== (const PrefixRankedBarTree &other) const |
operator string::LinearString< common::ranked_symbol< SymbolType > > () const | |
Creates a new instance of the string from a linear representation of a tree. More... | |
![]() | |
void | accessComponent () |
Friends | |
ext::ostream & | operator<< (ext::ostream &out, const PrefixRankedBarTree &instance) |
Additional Inherited Members | |
![]() | |
static void | registerComponent () |
static void | unregisterComponent () |
Tree structure represented as linear sequece as result of preorder traversal with additional bar symbols. The representation is so called ranked, therefore it consists of ranked symbols (bars are ranked as well). The rank of the ranked symbol needs to be compatible with unsigned integer.
The bars represent end mark of all subtrees in the notation.
T = (A, B \subset A, C), A (Alphabet) = finite set of ranked symbols, B (Bars) = finite set of ranked symbols representing bars, C (Content) = linear representation of the tree content
SymbolType | used for the symbol part of the ranked symbol |
|
explicit |
Creates a new instance of the tree with concrete alphabet, bars, and content.
bars | the initial bar set |
alphabet | the initial alphabet of the tree |
data | the initial tree in linear representation |
|
explicit |
Creates a new instance of the tree based on the content and bar set, the alphabet is implicitly created from the content.
bars | the initial bar set |
data | the initial tree in linear representation |
|
explicit |
Creates a new instance of the tree based on the RankedTree. The linear representation is constructed (including bars) by preorder traversal on the tree parameter. Symbol part of bars is provided as a parameter.
barBase | the symbol part of all bars |
tree | RankedTree representation of a tree. |
|
explicit |
Creates a new instance of the tree based on the RankedTree. The linear representation is constructed (including bars) by preorder traversal on the tree parameter. Bar symbols are created using some default value.
tree | RankedTree representation of a tree. |
|
inline |
Adder of an alphabet symbols.
symbols | the new symbols to be added to the alphabet |
|
inline |
Adder of symbols to a bar set.
symbols | the new symbols to be added to the bar set |
|
inline |
Getter of the alphabet.
|
inline |
Getter of the alphabet.
|
inline |
Getter of the bar set.
|
inline |
Getter of the bar set.
ext::vector< common::ranked_symbol< SymbolType > > && tree::PrefixRankedBarTree< SymbolType >::getContent | ( | ) | && |
Getter of the tree representation.
const ext::vector< common::ranked_symbol< SymbolType > > & tree::PrefixRankedBarTree< SymbolType >::getContent | ( | ) | const & |
Getter of the tree representation.
bool tree::PrefixRankedBarTree< SymbolType >::isEmpty |
|
inlineexplicit |
Creates a new instance of the string from a linear representation of a tree.
|
inline |
The three way comparison implementation
other | the other instance |
other
.
|
inline |
The equality comparison implementation.
other | the other object to compare with. |
void tree::PrefixRankedBarTree< SymbolType >::setContent | ( | ext::vector< common::ranked_symbol< SymbolType > > | data | ) |
Setter of the representation of the tree.
TreeException | when new tree representation is not valid or when symbol of the representation are not present in the alphabet |
data | new List of symbols forming the representation of the tree. |
|
friend |
Print this object as raw representation to ostream.
out | ostream where to print |
instance | object to print |