64 return std::numeric_limits<value_t>::max();
160 return v < 0 ? -v :
v;
199 conv(std::istream& i,
bool =
true)
const
205 raise(*
this,
": invalid value: ", i);
241 template <
typename RandomGenerator>
249 using super_t::super_t;
254 auto dis = std::uniform_real_distribution<>(super_t::min_, super_t::max_);
255 return dis(super_t::gen_);
value_t star(const value_t v) const
value_t rgcd(const value_t l, const value_t r) const
Print as is. For instance, don't try to escape labels.
char eat(std::istream &is, char c)
Check lookahead character and advance.
Print as a parsable type string.
Generic declaration of the class which is specialized in each weightset.
value_t lgcd(const value_t l, const value_t r) const
static constexpr star_status_t star_status()
static bool is_zero(const value_t v)
value_t ldivide(const value_t l, const value_t r) const
An input/output format for valuesets.
Abstract class for random weight generation.
static bool equal(const value_t l, const value_t r)
weightset_mixin< detail::r_impl > r
void require(Bool b, Args &&...args)
If b is not verified, raise an error with args as message.
Provide a variadic mul on top of a binary mul(), and one().
typename super_t::weight_t value_t
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
auto hash_value(const T &v) -> decltype(std::hash< T >
Following the naming convention of Boost.
static size_t hash(const value_t v)
static value_t conv(z, const z::value_t v)
static constexpr bool has_lightening_weights()
static value_t transpose(const value_t v)
static bool is_one(const value_t v)
Print as rich UTF-8 text, escaped.
value_t pick_value_() const
static value_t abs(const value_t v)
std::ostream & print_set(std::ostream &o, format fmt={}) const
static bool less(const value_t lhs, const value_t rhs)
Whether lhs < rhs.
Print as plain (ASCII) text, escaped.
static value_t add(const value_t l, const value_t r)
static value_t mul(const value_t l, const value_t r)
static constexpr bool is_commutative()
static value_t conv(q, const q::value_t v)
valid iff proper succeeds on the "absolute value" of the automaton
static constexpr bool is_special(const value_t)
typename r::value_t weight_t
static value_t sub(const value_t l, const value_t r)
value_t rdivide(const value_t l, const value_t r) const
ATTRIBUTE_NORETURN void raise_not_starrable(const WeightSet &ws, const typename WeightSet::value_t &w)
This value is not starrable.
static constexpr bool show_one()
static r make(std::istream &is)
Build from the description in is.
static value_t conv(b, const b::value_t v)
static std::ostream & print(const value_t v, std::ostream &o=std::cout, format={})
value_t conv(std::istream &i, bool=true) const
static value_t conv(self_t, const value_t v)
static constexpr bool is_idempotent()