61 static unsigned int abs(
int a)
63 return a < 0 ? -a : a;
148 return v.
num == 1 && v.
den == 1;
206 conv(std::istream& i,
bool =
true)
210 raise(
sname(),
": invalid numerator: ", i);
229 raise(
sname(),
": invalid denominator: ", i);
247 o <<
"\\frac{" << v.
num <<
"}{" << v.
den <<
'}';
266 raise(
"invalid format: ", fmt);
static value_t sub(const value_t l, const value_t r)
ATTRIBUTE_PURE unsigned int gcd(unsigned int a, unsigned int b)
Greatest common divisor.
static constexpr bool is_commutative()
std::ostream & print_set(std::ostream &o, format fmt={}) const
static value_t lgcd(const value_t l, const value_t r)
GCD: arbitrarily the first argument.
static value_t rdiv(const value_t l, const value_t r)
value_t(int n=0, unsigned d=1)
std::istringstream is
The input stream: the specification to translate.
static value_t rgcd(const value_t l, const value_t r)
weightset_mixin< detail::b_impl > b
char eat(std::istream &is, char c)
Check lookahead character and advance.
static value_t ldiv(const value_t l, const value_t r)
static value_t mul(const value_t l, const value_t r)
static bool is_one(const value_t v)
static bool is_zero(const value_t v)
static value_t add(const value_t l, const value_t r)
auto hash_value(const T &v) -> decltype(std::hash< T >
Following the naming convention of Boost.
value_t & reduce()
Put it in normal form.
void hash_combine(std::size_t &seed, const T &v)
static q make(std::istream &is)
Build from the description in is.
static size_t hash(const value_t v)
static value_t transpose(const value_t v)
Provide a variadic mul on top of a binary mul(), and one().
static value_t conv(std::istream &i, bool=true)
static bool is_special(const value_t)
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 less(const value_t lhs, const value_t rhs)
Whether lhs < rhs.
std::string to_string(direction d)
Conversion to string.
static value_t conv(b, const b::value_t v)
valid iff proper succeeds on the "absolute value" of the automaton
static constexpr bool show_one()
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
static unsigned int abs(int a)
static bool equal(const value_t l, const value_t r)
static value_t abs(const value_t v)
static constexpr star_status_t star_status()
static value_t conv(self_t, const value_t v)
ATTRIBUTE_PURE unsigned int lcm(unsigned int a, unsigned int b)
Lowest common multiple.
static value_t conv(z, const z::value_t v)
value_t star(const value_t v) const
weightset_mixin< detail::z_impl > z
static std::ostream & print(const value_t v, std::ostream &o, format fmt={})