Group Bottom-Up Iteration
Tag that specifies a VSTreeIterator to traverse the virtual string tree from the root towards the leafs.

Grouped Tags Overview

Grouped Function Overview

Detailed Description

Examples

The following example shows how the BottomUp tag is used.

#include <seqan/index.h>

using namespace seqan;

int main ()
{
    typedef Index<CharString> TIndex;
    TIndex index("TATAA");

    Iterator<TIndex, BottomUp<Postorder> >::Type itDefault;
    itDefault = begin(index, BottomUp<Postorder>());

    while(!isRoot(itDefault))
    {
        std::cout << representative(itDefault) << std::endl;
        goNext(itDefault);
    }

    return 0;
}
AA
ATAA
A
TAA
TATAA
TA

Grouped Tags Detail

Postorder

Post-order traversal of the virtual string tree.

Grouped Functions Detail

bool atEnd(iterator);

Defined in
<seqan/index.h>
Determines whether an virtual string tree iterator is at the end position.

Parameters

iterator An iterator.

Returns

bool true if iterator points behind the last item of the container, otherwise false.

Examples

The following example shows the usage of the atEnd function.

#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;
}