44 return std::numeric_limits<value_t>::infinity();
55 return -
std::log(std::exp(-l) + std::exp(-r));
60 return -
std::log(std::exp(-l) - std::exp(-r));
144 conv(std::istream& i,
bool =
true)
const
152 else if (! (i >> res))
153 raise(*
this,
": invalid value: ", i);
173 o <<
"\\mathrm{Log}";
static constexpr star_status_t star_status()
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
static value_t transpose(const value_t v)
static constexpr bool has_lightening_weights()
weightset_mixin< detail::log_impl > log
Print as a parsable type string.
void require(Bool b, Args &&...args)
If b is not verified, raise an error with args as message.
static bool is_zero(const value_t v)
static bool is_one(const value_t v)
static value_t one()
The neutral element for the log semiring is 0.
static value_t conv(self_t, const value_t v)
auto hash_value(const T &v) -> decltype(std::hash< T >
Following the naming convention of Boost.
value_t rdivide(const value_t l, const value_t r) const
std::ostream & print_set(std::ostream &o, format fmt={}) const
value_t ldivide(const value_t l, const value_t r) const
static bool equal(const value_t l, const value_t r)
static value_t zero()
The zero for the log semiring is +oo.
static constexpr bool is_idempotent()
value_t star(const value_t v) const
static value_t add(const value_t l, const value_t r)
An input/output format for valuesets.
static constexpr bool is_commutative()
static constexpr bool is_special(const value_t)
static size_t hash(const value_t v)
static constexpr bool show_one()
Print as is. For instance, don't try to escape labels.
static log make(std::istream &is)
Build from the description in is.
Print as rich UTF-8 text, escaped.
static bool less(const value_t lhs, const value_t rhs)
Whether lhs < rhs.
static std::ostream & print(const value_t v, std::ostream &o=std::cout, format fmt={})
Provide a variadic mul on top of a binary mul(), and one().
value_t conv(std::istream &i, bool=true) const
static value_t sub(const value_t l, const value_t r)
Print as plain (ASCII) text, escaped.
static value_t mul(const value_t l, const value_t r)
char eat(std::istream &is, char c)
Check lookahead character and advance.
weightset_mixin< detail::r_impl > r