Concept StringTreeConceptAnd index that can be accessed as suffix or prefix tree/trie.
And index that can be accessed as suffix or prefix tree/trie.
Defined in | <seqan/index.h> |
---|---|
Signature |
StringTreeConcept<T>
|
Interface Function Overview
-
TIterator begin(index, tag);
Returns an iterator pointing to the root node of a string tree index. -
void resizeVertexMap(index, pm);
Initializes a vertex map.
Interface Metafunction Overview
-
Iterator<TIndex, TSpec>::Type;
Returns the type of an iterator to traverse the nodes of a string tree. -
VertexDescriptor<TIndex>::Type;
Returns the type of an object that represents a string tree node.
Interface Functions Detail
TIterator begin(index, tag);
Returns an iterator pointing to the root node of a string tree index.
Parameters
index
|
An index that implements the StringTreeConcept. Types: IndexEsa, IndexDfi, IndexWotd, FMIndex. |
---|---|
tag
|
The specialisation of the iterator to be returned by the function. Types: VSTreeIterator |
Returns
TIterator |
Returns an iterator pointing to the root node of the virtual string tree of the index. The type is the result of Iterator<Index<TText, TIndexSpec>, TSpec >::Type |
---|
Examples
The following example shows the usage of the begin function. Note that in the first case begin returns an iterator pointing to the root node, while in the second case begin returns a pointer to the left most node.
#include <seqan/index.h> using namespace seqan; int main () { typedef Index<CharString> TIndex; TIndex index("TATAA"); Iterator<TIndex, TopDown<ParentLinks<> > >::Type itDefault; itDefault = begin(index, TopDown<ParentLinks<> >()); while(!atEnd(itDefault)) { std::cout << representative(itDefault) << std::endl; goNext(itDefault); } std::cout << "--------------------------------" << std::endl; Iterator<TIndex, TopDown<ParentLinks<Postorder> > >::Type itPostOrder; itPostOrder = begin(index, TopDown<ParentLinks<Postorder> >()); while(!atEnd(itPostOrder)) { std::cout << representative(itPostOrder) << std::endl; goNext(itPostOrder); }; return 0; }
The output is as follows:
A AA ATAA TA TAA TATAA -------------------------------- AA ATAA A TAA TATAA TA
void resizeVertexMap(index, pm);
Initializes a vertex map.
Parameters
index
|
An index with a string tree interface. Types: IndexEsa, IndexWotd |
---|---|
pm
|
An External Property Map. |