1 #ifndef VCSN_WEIGHTSET_F2_HH
2 # define VCSN_WEIGHTSET_F2_HH
29 std::string
vname(
bool =
true)
const
89 require(v != 1,
"f2: star: invalid value: 1");
151 if ((stream >> i) && (i == 0 || i == 1))
159 const std::string& =
"text")
161 return o << (v ?
'1' :
'0');
167 if (format ==
"latex")
168 o <<
"\\mathbb{F}_2";
169 else if (format ==
"text")
172 raise(
"invalid format: ", format);
185 #endif // !VCSN_WEIGHTSET_F2_HH
static bool is_zero(const value_t v)
static value_t conv(std::istream &stream)
static value_t mul(const value_t l, const value_t r)
std::ostream & print_set(std::ostream &o, symbol format=symbol{"text"}) const
static constexpr star_status_t star_status()
boost::flyweight< std::string, boost::flyweights::no_tracking > symbol
An internalized string.
static value_t rdiv(const value_t l, const value_t r)
static constexpr bool show_one()
static f2 make(std::istream &is)
Build from the description in is.
std::size_t hash_value(const T &v)
static std::string sname()
static bool equals(const value_t l, const value_t r)
static bool less_than(value_t lhs, value_t rhs)
Whether lhs < rhs.
static value_t star(const value_t v)
std::istringstream is
The input stream: the specification to translate.
static value_t sub(const value_t l, const value_t r)
static size_t hash(value_t v)
static bool is_one(const value_t v)
static constexpr bool is_special(value_t)
static value_t ldiv(const value_t l, const value_t r)
static constexpr bool is_commutative()
Provide a variadic mul on top of a binary mul(), and one().
variadic_mul_mixin< detail::f2_impl > f2
char eat(std::istream &is, char c)
Check lookahead character and advance.
static value_t add(const value_t l, const value_t r)
ATTRIBUTE_NORETURN void fail_reading(std::istream &is, std::string explanation)
Throw an exception after failing to read from is.
static std::ostream & print(const value_t v, std::ostream &o, const std::string &="text")
std::string vname(bool=true) const
static value_t transpose(const value_t v)
static constexpr bool is_idempotent()
variadic_mul_mixin< detail::r_impl > r
static value_t conv(self_type, value_t v)
void require(bool b, Args &&...args)
If b is not verified, raise an error with args as message.