29 int main(
int argc,
char **argv) {
32 const bool useRePair = argParser.
isSet(
"r");
33 string filename =
"data/1998statistics.xml";
36 }
else if (useRePair) {
38 string arg = argParser.
get<
string>(
"r",
"");
39 filename = (arg ==
"") ? filename : arg;
41 const bool writeDotFiles = argParser.
isSet(
"w");
64 cout <<
"Top DAG construction took " << timer.
getAndReset() <<
"ms" << endl;
68 const double percentage = (edges * 100.0) / treeEdges;
69 const double ratio = ((int)(1000 / percentage)) / 10.0;
70 cout <<
"Top dag has " << topDag.
nodes.size() - 1 <<
" nodes, " << edges <<
" edges (" << percentage
71 <<
"% of original tree, " << ratio <<
":1)" << endl;
Transform a tree into its top tree.
Export a tree as a DOT graph.
vector< DagNode< DataType > > nodes
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
Export a Top DAG as a DOT graph.
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)
int main(int argc, char **argv)
T get(const string &key, const T defaultValue=T())
Transform a tree into its top tree.
string summary() const
A one-line summary of the tree.
Base class for exporting various graphs (or trees) as DOT files.
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.