160 conv(std::istream& is,
bool =
true)
const
166 *
this,
": invalid value: ", i);
170 raise(*
this,
": invalid value: ", is);
177 return o << (v ?
'1' :
'0');
186 o <<
"\\mathbb{F}_2";
206 template <
typename RandomGenerator>
214 using super_t::super_t;
219 auto dis = std::uniform_int_distribution<>(super_t::min_, super_t::max_);
220 if (dis(super_t::gen_))
221 return super_t::ws_.zero();
223 return super_t::ws_.one();
weightset_mixin< detail::f2_impl > f2
Print as is. For instance, don't try to escape labels.
static value_t mul(const value_t l, const value_t r)
char eat(std::istream &is, char c)
Check lookahead character and advance.
static bool is_one(const value_t v)
Print as a parsable type string.
Generic declaration of the class which is specialized in each weightset.
static constexpr bool show_one()
static bool equal(const value_t l, const value_t r)
static std::ostream & print(const value_t v, std::ostream &o=std::cout, format={})
std::ostream & print_set(std::ostream &o, format fmt={}) const
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().
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 value_t add(const value_t l, const value_t r)
static value_t sub(const value_t l, const value_t r)
typename super_t::weight_t value_t
static constexpr star_status_t star_status()
Print as rich UTF-8 text, escaped.
static bool is_zero(const value_t v)
Print as plain (ASCII) text, escaped.
static value_t conv(self_t, value_t v)
static value_t transpose(const value_t v)
typename f2::value_t weight_t
static size_t hash(value_t v)
value_t rdivide(const value_t l, const value_t r) const
value_t ldivide(const value_t l, const value_t r) const
static constexpr bool is_special(value_t)
static f2 make(std::istream &is)
Build from the description in is.
value_t pick_value_() const
ATTRIBUTE_NORETURN void raise_not_starrable(const WeightSet &ws, const typename WeightSet::value_t &w)
This value is not starrable.
static constexpr bool is_commutative()
static constexpr bool is_idempotent()
value_t conv(std::istream &is, bool=true) const
value_t star(const value_t v) const
static bool less(value_t lhs, value_t rhs)
Whether lhs < rhs.
static constexpr bool has_lightening_weights()