30template <
class SymbolType = DefaultSymbolType >
31class PrefixRankedTree;
36#include <ext/algorithm>
51#include <string/LinearString.h>
70template <
class SymbolType >
71class PrefixRankedTree final :
public core::Components < PrefixRankedTree < SymbolType >, ext::set < common::ranked_symbol < SymbolType > >, component::Set, GeneralAlphabet > {
120 return this->
template accessComponent < GeneralAlphabet > ( ).get ( );
129 return std::move ( this->
template accessComponent < GeneralAlphabet > ( ).
get ( ) );
138 this->
template accessComponent < GeneralAlphabet > ( ).add ( symbols );
200 out <<
"(PrefixRankedTree";
202 out <<
" content = " << instance.
getContent ( );
217template <
class SymbolType >
219 setContent ( std::move ( data ) );
222template <
class SymbolType >
226template <
class SymbolType >
230template <
class SymbolType >
234template <
class SymbolType >
239template <
class SymbolType >
241 return std::move ( this->m_Data );
244template <
class SymbolType >
246 arityChecksum ( data );
250 throw TreeException (
"Input symbols not in the alphabet." );
253 this->m_Data = std::move ( data );
256template <
class SymbolType >
259 return current + symbol.getRank ( ) - 1;
264template <
class SymbolType >
266 return this->m_Data.empty ( );
278template <
class SymbolType >
292 return std::find ( content.
begin ( ), content.
end ( ), symbol ) != content.
end ( );
322template <
class SymbolType >
static ext::vector< common::ranked_symbol< DefaultSymbolType > > normalizeRankedSymbols(ext::vector< common::ranked_symbol< SymbolType > > &&symbols)
Definition: SymbolNormalize.h:113
static ext::set< common::ranked_symbol< DefaultSymbolType > > normalizeRankedAlphabet(ext::set< common::ranked_symbol< SymbolType > > &&symbols)
Definition: SymbolNormalize.h:59
Definition: ranked_symbol.hpp:20
Definition: components.hpp:181
static bool available(const tree::PrefixRankedTree< SymbolType > &, const common::ranked_symbol< SymbolType > &)
Definition: PrefixRankedTree.h:303
static void valid(const tree::PrefixRankedTree< SymbolType > &, const common::ranked_symbol< SymbolType > &)
Definition: PrefixRankedTree.h:313
static bool used(const tree::PrefixRankedTree< SymbolType > &tree, const common::ranked_symbol< SymbolType > &symbol)
Definition: PrefixRankedTree.h:289
Definition: setComponents.hpp:26
Output iterator calling a callback function on assignment.
Definition: iterator.hpp:923
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: set.hpp:99
auto end() &
Inherited behavior of end for non-const instance.
Definition: set.hpp:129
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: vector.hpp:125
auto end() &
Inherited behavior of end for non-const instance.
Definition: vector.hpp:155
Linear string.
Definition: LinearString.h:57
Tree structure represented as linear sequece as result of postorder traversal. The representation is ...
Definition: PostfixRankedTree.h:73
Tree structure represented as linear sequece as result of preorder traversal. The representation is s...
Definition: PrefixRankedTree.h:71
void setContent(ext::vector< common::ranked_symbol< SymbolType > > data)
Definition: PrefixRankedTree.h:245
ext::set< common::ranked_symbol< SymbolType > > && getAlphabet() &&
Definition: PrefixRankedTree.h:128
PrefixRankedTree(ext::set< common::ranked_symbol< SymbolType > > alphabet, ext::vector< common::ranked_symbol< SymbolType > > data)
Creates a new instance of the tree with concrete alphabet and content.
Definition: PrefixRankedTree.h:218
friend ext::ostream & operator<<(ext::ostream &out, const PrefixRankedTree &instance)
Definition: PrefixRankedTree.h:199
bool operator==(const PrefixRankedTree &other) const
Definition: PrefixRankedTree.h:187
void extendAlphabet(const ext::set< common::ranked_symbol< SymbolType > > &symbols)
Definition: PrefixRankedTree.h:137
bool isEmpty() const
Definition: PrefixRankedTree.h:265
const ext::set< common::ranked_symbol< SymbolType > > & getAlphabet() const &
Definition: PrefixRankedTree.h:119
const ext::vector< common::ranked_symbol< SymbolType > > & getContent() const &
Definition: PrefixRankedTree.h:235
Tree structure represented in its natural representation. The representation is so called ranked,...
Definition: RankedTree.h:72
static ext::vector< common::ranked_symbol< SymbolType > > postfixToPrefix(const ext::vector< common::ranked_symbol< SymbolType > > &src)
Definition: TreeAuxiliary.h:162
static ext::vector< common::ranked_symbol< SymbolType > > treeToPrefix(const ext::tree< common::ranked_symbol< SymbolType > > &tree)
Definition: TreeAuxiliary.h:185
Definition: TreeException.h:15
Definition: BarSymbol.cpp:12
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
Definition: Permutation.hpp:18
Definition: normalize.hpp:10
Definition: sigHandler.cpp:20
constexpr tuple< Elements &... > tie(Elements &... args) noexcept
Helper of extended tuple of references construction. The tuple is constructed to reffer to values in ...
Definition: tuple.hpp:218
auto begin(Container &&cont) -> decltype(std::forward(cont).begin())
Definition: iterator.hpp:900
void end()
Definition: measurements.cpp:19
auto & get(ext::ptr_array< Type, N > &tpl)
Specialisation of get function for pointer arrays.
Definition: ptr_array.hpp:693
Definition: BackwardOccurrenceTest.h:17
static tree::PrefixRankedTree< > eval(tree::PrefixRankedTree< SymbolType > &&value)
Definition: PrefixRankedTree.h:324
Definition: normalize.hpp:13