diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-07-10 13:02:28 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-07-10 13:02:28 +1000 |
commit | eaca4d39f176acbcc567d0cb18dd9fb6c92ad60d (patch) | |
tree | 9c4da52ed0af6484963d61b3477463c621604d10 /impl/main.cpp | |
parent | f9fc35785b53aa097a09ab1b865d33497ee1802e (diff) |
A few other changes that were needed for tests
I must have forgotten to commit them earlier. How annoying.
Diffstat (limited to 'impl/main.cpp')
-rw-r--r-- | impl/main.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/impl/main.cpp b/impl/main.cpp index 726fa3e..2b7a9a1 100644 --- a/impl/main.cpp +++ b/impl/main.cpp @@ -98,7 +98,7 @@ void treeToSystem(pANTLR3_BASE_TREE node, EquationSystem<T>& system) { typedef Complete<int> ZBar; int main (int argc, char* argv[]) { if (argc <= 3) { - cout << "Usage: " << argv[0] << " filename fixpoint strategy [log]" << endl + cerr << "Usage: " << argv[0] << " filename fixpoint strategy [log]" << endl << " fixpoint: naive | smart" << endl << " strategy: naive | repeat | smart" << endl << " log: section[,section[,section[...]]]" << endl; @@ -135,12 +135,12 @@ int main (int argc, char* argv[]) { FixpointAlgorithm<ZBar>* algorithm = NULL; if (!strcmp(argv[2], "naive")) { algorithm = new NaiveFixpointAlgorithm<ZBar>(system); - cout << "Naive fixpoint" << endl; + log::info << "Naive fixpoint" << endl; } else if (!strcmp(argv[2], "smart")) { algorithm = new SmartFixpointAlgorithm<ZBar>(system); - cout << "Smart fixpoint" << endl; + log::info << "Smart fixpoint" << endl; } else { - cout << "Unknown fixpoint algorithm." << endl; + cerr << "Unknown fixpoint algorithm." << endl; } // PARSE ARGUMENTS - strat improvement @@ -148,15 +148,15 @@ int main (int argc, char* argv[]) { ImprovementOperator<ZBar>* improvement = NULL; if (!strcmp(argv[3], "repeat")) { improvement = new RepeatedImprovementOperator<ZBar>(*naiveImprovement); - cout << "Repeated strategy improvement" << endl; + log::info << "Repeated strategy improvement" << endl; } else if (!strcmp(argv[3], "naive")) { improvement = naiveImprovement; - cout << "Naive strategy improvement" << endl; + log::info << "Naive strategy improvement" << endl; } else if (!strcmp(argv[3], "smart")) { improvement = new SmartImprovementOperator<ZBar>(system); - cout << "Smart strategy improvement" << endl; + log::info << "Smart strategy improvement" << endl; } else { - cout << "Unknown strategy improvement algorithm." << endl; + cerr << "Unknown strategy improvement algorithm." << endl; } if (!improvement || !algorithm) { exit(1); @@ -182,7 +182,6 @@ int main (int argc, char* argv[]) { log::debug << "Changed: " << (changed ? "true" : "false") << std::endl; } while(changed); - cout << endl; for (unsigned int i = 0, size = system.variableCount(); i < size; ++i) { Variable<ZBar>& var = system.variable(i); cout << var.name() << " = " << result[var] << endl; |