62 return std::numeric_limits<value_t>::max();
102 *
this,
": div: invalid division: ", l,
'/', r);
182 conv(std::istream& is,
bool =
true)
const
224 template <
typename RandomGenerator>
232 using super_t::super_t;
238 = std::uniform_int_distribution<>(super_t::min_, super_t::max_);
239 return dis(super_t::gen_);
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 star(const value_t v) const
static value_t conv(self_t, value_t v)
static bool equal(const value_t l, const value_t r)
static value_t add(const value_t l, const value_t r)
static constexpr bool has_lightening_weights()
static value_t sub(const value_t l, const value_t r)
ATTRIBUTE_PURE unsigned int gcd(unsigned int a, unsigned int b)
Greatest common divisor.
An input/output format for valuesets.
Abstract class for random weight generation.
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().
static bool is_one(const value_t v)
static constexpr bool is_idempotent()
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.
std::ostream & print_set(std::ostream &o, format fmt={}) const
static value_t mul(const value_t l, const value_t r)
value_t rdivide(const value_t l, const value_t r) const
Print as rich UTF-8 text, escaped.
static value_t transpose(const value_t v)
Print as plain (ASCII) text, escaped.
value_t conv(std::istream &is, bool=true) const
value_t lgcd(const value_t l, const value_t r) const
static bool less(value_t lhs, value_t rhs)
Whether lhs < rhs.
typename z::value_t weight_t
static constexpr bool is_commutative()
static constexpr bool is_special(value_t)
value_t pick_value_() const override
static z make(std::istream &is)
Build from the description in is.
ATTRIBUTE_NORETURN void fail_reading(std::istream &is, Args &&...args)
Throw an exception after failing to read from is.
static constexpr star_status_t star_status()
weightset_mixin< detail::z_impl > z
static size_t hash(value_t v)
value_t rgcd(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 bool is_zero(const value_t v)
static constexpr bool show_one()
static std::ostream & print(const value_t v, std::ostream &o=std::cout, format={})
typename super_t::weight_t value_t
static value_t conv(b, b::value_t v)
value_t ldivide(const value_t l, const value_t r) const