31 int main(
int argc,
char **argv) {
34 const bool useRePair = argParser.
isSet(
"r");
35 string filename =
"data/1998statistics.xml";
38 }
else if (useRePair) {
40 string arg = argParser.
get<
string>(
"r",
"");
41 filename = (arg ==
"") ? filename : arg;
43 const bool print = argParser.
isSet(
"p");
60 cout <<
"Top DAG construction took " << timer.
getAndReset() <<
"ms";
64 const double percentage = (edges * 100.0) / treeEdges;
65 const double ratio = ((int)(1000 / percentage)) / 10.0;
66 cout <<
"Top dag has " << dag.
nodes.size() - 1 <<
" nodes, " << edges <<
" edges (" << percentage
67 <<
"% of original tree, " << ratio <<
":1)" << endl;
87 long long maxTreeStackSize = trav.
run();
88 cout <<
"Preorder traversal took " << timer.
get() <<
"ms, max tree stack size = " << maxTreeStackSize <<
" Bytes" << endl;
Transform a tree into its top tree.
vector< DagNode< DataType > > nodes
Traverse an in-memory Top DAG in preorder.
Ordered tree data structure.
string getDataArg(const int index) const
get a data argument by its index (among the data arguments)
bool isSet(const string &arg) const
check whether an argument was set
uint numDataArgs() const
the number of unnamed data arguments
Read an XML file into a tree, using RapidXml.
Parse command-line arguments.
void construct(DebugInfo *debugInfo=NULL)
T get(const string &key, const T defaultValue=T())
Transform a tree into its top tree.
int main(int argc, char **argv)
string summary() const
A one-line summary of the tree.
long long run()
Do the traversal and print an XML representation to stdout.
int countEdges() const
Count the number of edges in the DAG.
A binary DAG that is specialised to be a top tree's minimal DAG.
void construct(DebugInfo *debugInfo=NULL, const double minRatio=1.2)
A key-value label storage.