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;
163 conv(std::istream& i,
bool =
true)
176 if (v.get_den() == 1)
179 o <<
"\\frac{" << v.get_num() <<
"}{" << v.get_den() <<
'}';
190 o <<
"\\mathbb{Q}_{\\text{mp}}";
194 raise(
"invalid format: ", fmt);
static bool is_special(const value_t)
static value_t abs(const value_t v)
std::ostream & print_set(std::ostream &o, format fmt={}) const
static value_t rdiv(const value_t l, const value_t r)
weightset_mixin< detail::r_impl > r
static value_t transpose(const value_t v)
static value_t conv(z, z::value_t v)
static std::ostream & print(const value_t v, std::ostream &o, format fmt={})
static value_t ldiv(const value_t l, const value_t r)
std::istringstream is
The input stream: the specification to translate.
weightset_mixin< detail::b_impl > b
char eat(std::istream &is, char c)
Check lookahead character and advance.
static value_t add(const value_t l, const value_t r)
value_t star(const value_t v) const
static constexpr bool show_one()
auto hash_value(const T &v) -> decltype(std::hash< T >
Following the naming convention of Boost.
static bool is_one(const value_t v)
Provide a variadic mul on top of a binary mul(), and one().
static constexpr bool is_commutative()
static value_t conv(self_t, value_t v)
weightset_mixin< detail::q_impl > q
void require(bool b, Args &&...args)
If b is not verified, raise an error with args as message.
static bool equal(const value_t l, const value_t r)
static size_t hash(value_t v)
std::string to_string(direction d)
Conversion to string.
valid iff proper succeeds on the "absolute value" of the automaton
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
static qmp make(std::istream &is)
Build from the description in is.
static value_t conv(std::istream &i, bool=true)
weightset_mixin< detail::qmp_impl > qmp
static constexpr star_status_t star_status()
static value_t conv(b, b::value_t v)
static value_t mul(const value_t l, const value_t r)
static value_t sub(const value_t l, const value_t r)
weightset_mixin< detail::z_impl > z
static bool less(value_t l, value_t r)
Whether < r.
static bool is_zero(const value_t v)