167 conv(std::istream& is,
bool =
true)
const 172 if (i != 0 && i != 1)
184 return o << (v ?
'1' :
'0');
193 o <<
"\\mathbb{F}_2";
213 template <
typename RandomGenerator>
221 using super_t::super_t;
226 auto dis = std::uniform_int_distribution<>(super_t::min_, super_t::max_);
227 if (dis(super_t::gen_))
228 return super_t::ws_.
zero();
230 return super_t::ws_.one();
static f2 make(std::istream &is)
Build from the description in is.
Print as a parsable type string.
static int compare(const value_t l, const value_t r)
Three-way comparison between l and r.
weightset_mixin< detail::r_impl > r
static bool less(value_t l, value_t r)
Whether lhs < rhs.
static constexpr star_status_t star_status()
static value_t mul(const value_t l, const value_t r)
typename super_t::weight_t value_t
ATTRIBUTE_NORETURN void raise_invalid_value(const ValueSet &vs, Args &&... args)
Cannot make a value from this.
weightset_mixin< detail::f2_impl > f2
static constexpr bool show_one()
char eat(std::istream &is, char c)
Check lookahead character and advance.
static size_t hash(value_t v)
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
static bool is_zero(const value_t v)
static value_t sub(const value_t l, const value_t r)
value_t ldivide(const value_t l, const value_t r) const
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().
static value_t transpose(const value_t v)
value_t conv(std::istream &is, bool=true) const
static value_t conv(self_t, value_t v)
static constexpr bool is_idempotent()
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 constexpr bool is_commutative()
static bool equal(const value_t l, const value_t r)
Whether l == r.
Print as plain (ASCII) text, escaped.
static std::ostream & print(const value_t v, std::ostream &o=std::cout, format={})
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.
std::ostream & print_set(std::ostream &o, format fmt={}) const
Print as is. For instance, don't try to escape labels.
value_t star(const value_t v) const
static constexpr bool is_special(value_t)
Generic declaration of the class which is specialized in each weightset.
void require(Bool b, Args &&... args)
If b is not verified, raise an error with args as message.
static bool is_one(const value_t v)
typename weightset_t::value_t weight_t
value_t pick_value_() const
static constexpr bool has_lightening_weights()