Macaulay2 Engine
Loading...
Searching...
No Matches

◆ dump()

std::ostream & SuffixTreeNode::dump ( std::ostream & o,
int depth,
bool dumpChildren = true ) const

Definition at line 24 of file SuffixTree.cpp.

25{
26 if (mParent == nullptr)
27 {
28 // the parent is nullptr if and only if it is the root.
29 std::cout << "Root" << std::endl;
30 }
31 else
32 {
33 for (auto j = 0; j < depth; ++j) o << " ";
34 o << "Arclabel : ";
36 o << std::endl;
37
38 for (auto j = 0; j < depth; ++j) o << " ";
39 o << "Label : ";
41 o << std::endl;
42
43 for (auto j = 0; j < depth; ++j) o << " ";
44 o << "SuffixTreeLabel : ";
45 if (mSuffixLink == nullptr)
46 o << "nullptr";
47 else
48 outputLabel(o,mSuffixLink->mLabel);
49 o << std::endl;
50 }
51 if (dumpChildren)
52 {
53 for (auto pair : mChildren)
54 {
55 pair.second->dump(o,depth+1);
56 }
57 }
58 return o;
59}
void outputLabel(std::ostream &o, const Label &vec)
Definition SuffixTree.cpp:6
SuffixTreeNode * mParent
SuffixTreeNode * mSuffixLink
std::map< Label, SuffixTreeNode * > mChildren

References mArcLabel, mChildren, mLabel, mParent, mSuffixLink, and outputLabel().

Referenced by SuffixTree::operator<<, and operator<<.