44 return std::numeric_limits<value_t>::max();
55 return -
std::log(std::exp(-l) + std::exp(-r));
60 return -
std::log(std::exp(-l) - std::exp(-r));
88 return std::numeric_limits<value_t>::min();
144 conv(std::istream& i,
bool =
true)
152 else if (! (i >> res))
153 raise(
sname(),
": invalid value: ", i);
171 o <<
"\\mathrm{Log}";
175 raise(
"invalid format: ", fmt);
static value_t one()
The neutral element for the log semiring is 0.
static std::ostream & print(const value_t v, std::ostream &o, format fmt={})
static bool is_zero(const value_t v)
static value_t conv(self_t, const value_t v)
static value_t mul(const value_t l, const value_t r)
static bool equal(const value_t l, const value_t r)
weightset_mixin< detail::r_impl > r
static constexpr star_status_t star_status()
static constexpr bool is_special(const value_t)
static value_t sub(const value_t l, const value_t r)
std::istringstream is
The input stream: the specification to translate.
std::ostream & print_set(std::ostream &o, format fmt={}) const
static bool is_one(const value_t v)
char eat(std::istream &is, char c)
Check lookahead character and advance.
static value_t ldiv(const value_t l, const value_t r)
auto hash_value(const T &v) -> decltype(std::hash< T >
Following the naming convention of Boost.
static value_t zero()
The zero for the log semiring is +oo.
static constexpr bool show_one()
static size_t hash(const value_t v)
Provide a variadic mul on top of a binary mul(), and one().
static value_t add(const value_t l, const value_t r)
static log make(std::istream &is)
Build from the description in is.
void require(bool b, Args &&...args)
If b is not verified, raise an error with args as message.
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
static value_t conv(std::istream &i, bool=true)
static value_t rdiv(const value_t l, const value_t r)
static constexpr bool is_idempotent()
static bool less(const value_t lhs, const value_t rhs)
Whether lhs < rhs.
value_t star(const value_t v) const
static constexpr bool is_commutative()
weightset_mixin< detail::log_impl > log
static value_t transpose(const value_t v)