From 7d0b3fe297306d6bf009dfdd2df2452f35e341c1 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 24 Jan 2005 14:35:44 +0000 Subject: [PATCH] * src/tgbatest/randtgba.cc: Some fixes from Denis for ratio stats. --- ChangeLog | 4 ++++ src/tgbatest/randtgba.cc | 30 ++++++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 763e0652a..2af1b7f8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-01-24 Alexandre Duret-Lutz + + * src/tgbatest/randtgba.cc: Some fixes from Denis for ratio stats. + 2005-01-20 Alexandre Duret-Lutz * src/ltlast/formula.hh (formula_ptr_less_than): Two diff --git a/src/tgbatest/randtgba.cc b/src/tgbatest/randtgba.cc index c26170cbf..379c834f7 100644 --- a/src/tgbatest/randtgba.cc +++ b/src/tgbatest/randtgba.cc @@ -492,16 +492,16 @@ print_ar_stats(ar_stats_type& ar_stats) } void -print_ratio_stats(int nbac, const ratio_stat_type& ratio_stats) +print_ratio_stats(const std::string& s, const ratio_stat_type& ratio_stats) { std::cout << std::endl; std::ios::fmtflags old = std::cout.flags(); std::cout << std::right << std::fixed << std::setprecision(1); - std::cout << "Ratios about emptiness checkers: "; - if (nbac >= 0) - std::cout << "(" << nbac << " acceptance conditions)"; - std::cout << std::endl; + std::cout << "Ratios in case of non-emptiness (" << s << ")" + << std::endl; + std::cout << "" << std::endl; std::cout << std::setw(22) << "" << " | % states | % transitions |" << std::endl << std::setw(22) << "algorithm" @@ -912,7 +912,7 @@ main(int argc, char** argv) else { spot::tgba* degen = 0; - if (opt_degen && real_n_acc != 1) + if (opt_degen && real_n_acc > 1) degen = new spot::tgba_tba_proxy(a); int n_alg = sizeof(ec_algos) / sizeof(*ec_algos); @@ -954,8 +954,7 @@ main(int argc, char** argv) { // Notice that ratios are computed w.r.t. the // generalized automaton a. - int nba = a->number_of_acceptance_conditions(); - ratio_stats[nba][algo].count(ecs, a); + ratio_stats[real_n_acc][algo].count(ecs, a); glob_ratio_stats[algo].count(ecs, a); } } @@ -1164,12 +1163,19 @@ main(int argc, char** argv) if (!glob_ratio_stats.empty()) { - print_ratio_stats(-1, glob_ratio_stats); - for (ratio_stats_type::const_iterator i = ratio_stats.begin(); - i != ratio_stats.end(); ++i) - print_ratio_stats(i->first, i->second); + print_ratio_stats("all tests", glob_ratio_stats); + if (ratio_stats.size() > 1) + for (ratio_stats_type::const_iterator i = ratio_stats.begin(); + i != ratio_stats.end(); ++i) + { + std::ostringstream s; + s << "tests with " << i->first << " acceptance conditions"; + print_ratio_stats(s.str(), i->second); + } + } + if (!acss_stats.empty()) { std::cout << std::endl;