Function
countChildren
Count the number of children of a tree node.
countChildren(iterator)
Include Headers
seqan/index.h
Parameters
iterator
An iterator of a suffix tree.
Return Values
The number of children of a tree node. If iterator's container type is TIndex, the return type is Size<TIndex>::Type.
Examples
// this code is in seqan/index/index_esa_stree.h
 
 typedef Index< String<char> > TMyIndex;
 TMyIndex myIndex(myString);
 
 Iterator< TMyIndex, TopDown<ParentLinks<PreorderEmptyEdges> > >::Type tdIterator(myIndex);
 Size<TMyIndex>::Type count;
 
 while (!atEnd(tdIterator)) {
 // We print out the representatives of all nodes that have more than 3 children and the number of occurrences.
 count = countChildren(tdIterator);
 if (count >= 3)
 {
     ::std::cout << "Representative " << representative(tdIterator) << " has " <<  count << " children  and " << countOccurrences(tdIterator) << " Occurrences " << ::std::endl;
 
     ++tdIterator;
 }
Example Programs
SeqAn - Sequence Analysis Library - www.seqan.de
 

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