62 return std::numeric_limits<value_t>::max();
102 *
this,
": div: invalid division: ", l,
'/', r);
141 return int(l) - int(r);
189 conv(std::istream& is,
bool =
true)
const 231 template <
typename RandomGenerator>
239 using super_t::super_t;
245 = std::uniform_int_distribution<>(super_t::min_, super_t::max_);
246 return dis(super_t::gen_);
Print as a parsable type string.
static value_t conv(b, b::value_t v)
static value_t add(const value_t l, const value_t r)
weightset_mixin< detail::r_impl > r
static constexpr bool show_one()
static int compare(const value_t l, const value_t r)
Three-way comparison between l and r.
ATTRIBUTE_NORETURN void raise_invalid_value(const ValueSet &vs, Args &&... args)
Cannot make a value from this.
static value_t transpose(const value_t v)
static bool is_one(const value_t v)
static size_t hash(value_t v)
char eat(std::istream &is, char c)
Check lookahead character and advance.
weightset_mixin< detail::z_impl > z
static constexpr bool is_commutative()
static bool is_zero(const value_t v)
value_t rdivide(const value_t l, const value_t r) const
static bool less(value_t lhs, value_t rhs)
Whether lhs < rhs.
value_t pick_value_() const override
value_t ldivide(const value_t l, const value_t r) const
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
static value_t conv(self_t, value_t v)
static value_t mul(const value_t l, const value_t r)
Print as rich UTF-8 text, escaped.
An input/output format for valuesets.
Abstract class for random weight generation.
Provide a variadic mul on top of a binary mul(), and one().
typename super_t::weight_t value_t
auto hash_value(const T &v) -> decltype(std::hash< T >
Following the naming convention of Boost.
static z make(std::istream &is)
Build from the description in is.
static std::ostream & print(const value_t v, std::ostream &o=std::cout, format={})
value_t conv(std::istream &is, bool=true) const
static constexpr bool has_lightening_weights()
value_t rgcd(const value_t l, const value_t r) const
Print as plain (ASCII) text, escaped.
ATTRIBUTE_NORETURN void raise_not_starrable(const WeightSet &ws, const typename WeightSet::value_t &w)
This value is not starrable.
static constexpr bool is_idempotent()
Print as is. For instance, don't try to escape labels.
ATTRIBUTE_PURE unsigned int gcd(unsigned int a, unsigned int b)
Greatest common divisor.
Generic declaration of the class which is specialized in each weightset.
static value_t sub(const value_t l, const value_t r)
void require(Bool b, Args &&... args)
If b is not verified, raise an error with args as message.
static constexpr star_status_t star_status()
static bool equal(const value_t l, const value_t r)
Whether l == r.
value_t star(const value_t v) const
typename weightset_t::value_t weight_t
value_t lgcd(const value_t l, const value_t r) const
static constexpr bool is_special(value_t)
std::ostream & print_set(std::ostream &o, format fmt={}) const