Function
goUp
Iterates up one edge to the parent in a tree.
goUp(iterator)
Include Headers
seqan/index.h
Parameters
iterator
An iterator of a suffix tree.
Return Values
true if the iterator could be moved, otherwise false.
Types: bool
Examples
The following code shows how the function goUp is used.
1#include <seqan/index.h>
2
3using namespace seqan;
4
5int main ()
6{
7    typedef Index<CharString> TIndex;
8
9    TIndex index("tobeornottobe");
10    Iterator<TIndex, TopDown<ParentLinks<> > >::Type it(index);
11
12    do {
13        // Print theletters from the root to the current node
14        std::cout << representative(it) << std::endl;
15
16        if (!goDown(it) && !goRight(it))
17            while (goUp(it) && !goRight(it)) ;
18    } while (!isRoot(it));
19
20    return 0;
21}
be
beornottobe
e
eornottobe
nottobe
o
obe
obeornottobe
ornottobe
ottobe
rnottobe
t
tobe
tobeornottobe
ttobe
SeqAn - Sequence Analysis Library - www.seqan.de
 

Page built @2013/07/11 09:12:36