E.V.E  0.1-beta

◆ logspace_sub

eve::logspace_sub = {}
inlineconstexpr

Callable object computing the logspace_sub operation: \(\log\left(e^{x_0}-\sum_{i = 1}^n e^{x_i}\right)\).

Required header: #include <eve/function/logspace_sub.hpp>

Members Functions

Member Effect
operator() the logspace_sub operation
operator[] Construct a conditional version of current function object

template< floating_value T, floating_value U, floating_value ...Ts> auto operator()( T arg0, U arg1, Ts... args ) const noexcept
requires (compatible_values< T, U, Ts > && ...);
Definition: value.hpp:83

Parameters

arg0, arg1, args, ... : values.

Return value

The call logspace_sub(arg0, arg1, args...) is semantically equivalent to log(exp(arg0) - exp(arg1) - exp(args)...);.

The result type is the common compatible type of the parameters.


auto operator[]( conditional_expression auto cond ) const noexcept;

Higher-order function generating a masked version of eve::logspace_sub

Parameters

cond : conditional expression

Return value

A Callable object so that the expression logspace_sub[cond](x, ...) is equivalent to if_else(cond,logspace_sub(x, ...),x)


Supported decorators

  • eve::diff, eve::diff_1st, eve::diff_2nd, eve::diff_3rd, eve::diff_nth

    Required header: #include <eve/function/diff/logspace_sub.hpp>

    The expression diff_nth< N >(logspace_sub)(arg0,arg1,args...) computes the partial diff of the function relative to its Nth parameter. The returned value is 0 if N is greater that the actual number of parameters, otherwise if the parameters are \(x_1, ... x_n\) returns \(\displaystyle\frac{s e^{x_N}}{e^{x_1} - ... - e^{x_n}}\) where \(s\) is \(1\) if \(N = 1\) and \(-1\) otherwise.