Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Tree structure represented in its natural representation. The representation is so called ranked, therefore it consists of ranked symbols. The rank of the ranked symbol needs to be compatible with unsigned integer. More...
#include <RankedTree.h>
Public Member Functions | |
RankedTree (ext::set< common::ranked_symbol< SymbolType > > alphabet, ext::tree< common::ranked_symbol< SymbolType > > tree) | |
Creates a new instance of the tree with concrete alphabet and content. More... | |
RankedTree (ext::tree< common::ranked_symbol< SymbolType > > tree) | |
Creates a new instance of the tree based on the content, the alphabet is implicitly created from the content. More... | |
RankedTree (const UnrankedTree< SymbolType > &other) | |
Creates a new instance of the tree based on UnrankedTree, the alphabet is created from the content of the UnrankedTree. The alphabet is created since ranks cannot be deduced. More... | |
RankedTree (const PostfixRankedTree< SymbolType > &other) | |
Creates a new instance of the tree based on the PostfixRankedTree. The natural representation is recreated from postfix representation. More... | |
RankedTree (const PrefixRankedTree< SymbolType > &other) | |
Creates a new instance of the tree based on the PrefixRankedTree. The natural representation is recreated from prefix representation. 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::tree< common::ranked_symbol< SymbolType > > & | getContent () const & |
ext::tree< common::ranked_symbol< SymbolType > > && | getContent () && |
void | setTree (ext::tree< common::ranked_symbol< SymbolType > > tree) |
auto | operator<=> (const RankedTree &other) const |
bool | operator== (const RankedTree &other) const |
void | nicePrint (ext::ostream &os) const |
![]() | |
void | accessComponent () |
Friends | |
ext::ostream & | operator<< (ext::ostream &out, const RankedTree &instance) |
Additional Inherited Members | |
![]() | |
static void | registerComponent () |
static void | unregisterComponent () |
Tree structure represented in its natural representation. The representation is so called ranked, therefore it consists of ranked symbols. The rank of the ranked symbol needs to be compatible with unsigned integer.
T = (A, C), A (Alphabet) = finite set of ranked symbols, C (Content) = tree in its natural representation
SymbolType | used for the symbol part of the ranked symbol |
|
explicit |
Creates a new instance of the tree with concrete alphabet and content.
alphabet | the initial alphabet of the tree |
tree | the initial tree in its natural representation |
|
explicit |
Creates a new instance of the tree based on the content, the alphabet is implicitly created from the content.
tree | the initial tree in its natural representation |
|
explicit |
Creates a new instance of the tree based on UnrankedTree, the alphabet is created from the content of the UnrankedTree. The alphabet is created since ranks cannot be deduced.
other | the tree represented as UnrankedTree |
|
explicit |
Creates a new instance of the tree based on the PostfixRankedTree. The natural representation is recreated from postfix representation.
other | PostfixRankedTree representation of a tree. |
|
explicit |
Creates a new instance of the tree based on the PrefixRankedTree. The natural representation is recreated from prefix representation.
other | PrefixRankedTree representation of a tree. |
|
inline |
Adder of an alphabet symbols.
symbols | the new symbols to be added to the alphabet |
|
inline |
Getter of the alphabet.
|
inline |
Getter of the alphabet.
ext::tree< common::ranked_symbol< SymbolType > > && tree::RankedTree< SymbolType >::getContent | ( | ) | && |
Getter of the tree representation.
const ext::tree< common::ranked_symbol< SymbolType > > & tree::RankedTree< SymbolType >::getContent | ( | ) | const & |
Getter of the tree representation.
void tree::RankedTree< SymbolType >::nicePrint | ( | ext::ostream & | os | ) | const |
Hierarchical printer of the tree.
os | the output stream destination of the print |
|
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::RankedTree< SymbolType >::setTree | ( | ext::tree< common::ranked_symbol< SymbolType > > | tree | ) |
Setter of the representation of the tree.
TreeException | in same situations as checkAlphabet and checkArities |
tree | new representation of the tree. |
|
friend |
Print this object as raw representation to ostream.
out | ostream where to print |
instance | object to print |