49 return value_t{mpz_class(0), 1};
87 if (
abs(v.get_num()) < v.get_den())
89 return {v.get_den(), v.get_den() - v.get_num()};
101 return v.get_num() == 0;
107 return v.get_num() == 1 && v.get_den() == 1;
164 conv(std::istream& i,
bool =
true)
177 if (v.get_den() == 1)
180 o <<
"\\frac{" << v.get_num() <<
"}{" << v.get_den() <<
'}';
193 o <<
"\\mathbb{Q}_{\\text{mp}}";
static value_t sub(const value_t l, const value_t r)
weightset_mixin< detail::q_impl > q
static value_t add(const value_t l, const value_t r)
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
static value_t conv(b, b::value_t v)
static constexpr bool is_commutative()
static bool less(value_t l, value_t r)
Whether < r.
ATTRIBUTE_NORETURN void raise_not_starrable(const WeightSet &ws, const typename WeightSet::value_t &w)
This value is not starrable.
value_t star(const value_t v) const
static value_t mul(const value_t l, const value_t r)
Print as a parsable type string.
static bool is_zero(const value_t v)
void require(Bool b, Args &&...args)
If b is not verified, raise an error with args as message.
static value_t transpose(const value_t v)
static value_t abs(const value_t v)
static size_t hash(value_t v)
auto hash_value(const T &v) -> decltype(std::hash< T >
Following the naming convention of Boost.
static bool is_special(const value_t)
static value_t conv(std::istream &i, bool=true)
static value_t conv(self_t, value_t v)
An input/output format for valuesets.
Print as is. For instance, don't try to escape labels.
std::string to_string(direction d)
Conversion to string.
value_t rdivide(const value_t l, const value_t r) const
static constexpr bool show_one()
Print as rich UTF-8 text, escaped.
static constexpr bool has_lightening_weights()
std::ostream & print_set(std::ostream &o, format fmt={}) const
weightset_mixin< detail::qmp_impl > qmp
weightset_mixin< detail::z_impl > z
value_t ldivide(const value_t l, const value_t r) const
static bool equal(const value_t l, const value_t r)
weightset_mixin< detail::b_impl > b
static std::ostream & print(const value_t v, std::ostream &o=std::cout, format fmt={})
static value_t conv(z, z::value_t v)
Provide a variadic mul on top of a binary mul(), and one().
Print as plain (ASCII) text, escaped.
valid iff proper succeeds on the "absolute value" of the automaton
char eat(std::istream &is, char c)
Check lookahead character and advance.
static constexpr star_status_t star_status()
static bool is_one(const value_t v)
static qmp make(std::istream &is)
Build from the description in is.
weightset_mixin< detail::r_impl > r