* src/tgbatest/randtgba.cc: New option -H.
* src/tgbaalgos/emptiness_stats.hh (unsigned_statistics_copy): New class.
This commit is contained in:
parent
d5fb32120f
commit
f7fe379e60
3 changed files with 115 additions and 16 deletions
|
|
@ -52,6 +52,69 @@ namespace spot
|
|||
stats_map stats;
|
||||
};
|
||||
|
||||
/// \brief comparable statistics
|
||||
///
|
||||
/// This must be built from a spot::unsigned_statistics. But unlike
|
||||
/// spot::unsigned_statistics, it supports equality and inequality tests.
|
||||
/// (It's the only operations it supports, BTW.)
|
||||
class unsigned_statistics_copy
|
||||
{
|
||||
public:
|
||||
unsigned_statistics_copy()
|
||||
: set(false)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned_statistics_copy(const unsigned_statistics& o)
|
||||
: set(false)
|
||||
{
|
||||
seteq(o);
|
||||
}
|
||||
|
||||
bool
|
||||
seteq(const unsigned_statistics& o)
|
||||
{
|
||||
if (!set)
|
||||
{
|
||||
unsigned_statistics::stats_map::const_iterator i;
|
||||
for (i = o.stats.begin(); i != o.stats.end(); ++i)
|
||||
stats[i->first] = (o.*i->second)();
|
||||
set = true;
|
||||
return true;
|
||||
}
|
||||
if (*this == o)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
typedef std::map<const char*, unsigned, char_ptr_less_than> stats_map;
|
||||
stats_map stats;
|
||||
|
||||
|
||||
bool
|
||||
operator==(const unsigned_statistics_copy& o) const
|
||||
{
|
||||
stats_map::const_iterator i;
|
||||
for (i = stats.begin(); i != stats.end(); ++i)
|
||||
{
|
||||
stats_map::const_iterator i2 = o.stats.find(i->first);
|
||||
if (i2 == o.stats.end())
|
||||
return false;
|
||||
if (i->second != i2->second)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
operator!=(const unsigned_statistics_copy& o) const
|
||||
{
|
||||
return !(*this == o);
|
||||
}
|
||||
|
||||
bool set;
|
||||
};
|
||||
|
||||
/// \brief Emptiness-check statistics
|
||||
///
|
||||
/// Implementations of spot::emptiness_check may also implement
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue