| 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. Types: TopDownHistory Iterator, TopDownHistory Iterator
Return Values true if the iterator could be moved, otherwise false. Types: bool Member of RightArrayBinaryTree Iterator, TopDownHistory Iterator Examples The following code shows how the function goUp is used. File "index_iterator.cpp"
1 | #include <seqan/index.h>
2 |
3 | using namespace seqan;
4 |
5 | int 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 the letters 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 @2014/10/13 16:12:58