E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches
Arithmetic operations

Detailed Description

Core arithmetic functions

These functions allows performing some basic arithmetics operations and some less basic.

abs, absmax, absmi, add, agm, average, ceil, chi, clamp, copysign, [](eve::), cosine_similarity_, covariance, dec, dist, div, dot, fdim], floor, fmod, frac, fracscale, heaviside, inc, lerp, manhattan, max, maxabs, maxmag, min, minabs, minmag, minmax, minus, modf, mul, nearest, negabsmax, negabsmin, negate,negatenz, negmaxabs, negminabs, oneminus, rat, rec, reldist, rem, remainder, round, roundscale], rsqrt, saturate, sign, sign_alternate signnz, sqr, sqrt, sub, sum_of_squares, trunc, variance, welford_average, welford_covariance, welford_variance.

Variables

constexpr auto eve::abs = functor<abs_t>
 elementwise_callable object computing the absolute value of the parameter.
 
constexpr auto eve::absmax = functor<absmax_t>
 tuple_callable computing the absolute value of the maximal element.
 
constexpr auto eve::absmin = functor<absmin_t>
 tuple_callable computing the absolute value of the minimal element.
 
constexpr auto eve::add = functor<add_t>
 tuple_callable computing the sum of its arguments.
 
constexpr auto eve::agm = functor<agm_t>
 elementwise_callable object computing the the arithmetic-geometric mean.
 
constexpr auto eve::average = functor<average_t>
 tuple_callable computing the arithmetic mean of its arguments.
 
constexpr auto eve::ceil = functor<ceil_t>
 strict_elementwise_callable object computing the smallest integer not less than the input.
 
constexpr auto eve::chi = functor<chi_t>
 callable indicatrix of the interval \([lo, hi[\) or of the set for which the invocable returns true.
 
constexpr auto eve::clamp = functor<clamp_t>
 elementwise_callable clamping the value between two bounds.
 
constexpr auto eve::copysign = functor<copysign_t>
 elementwise_callable object computing the composition of a value with the magnitude of the first parameter and the bit of sign of the second one.
 
constexpr auto eve::cosine_similarity = functor<cosine_similarity_t>
 elementwise_callable object computing the elementwise cosine_similarity of the vector of the first half parameters by the vector of the last half.
 
constexpr auto eve::covariance = functor<covariance_t>
 elementwise_callable object computing the elementwise covariance product of the vector of the first half parameters by the vector of the last half.
 
constexpr auto eve::dec = functor<dec_t>
 elementwise_callable object returning the input decremented by 1.
 
constexpr auto eve::dist = functor<dist_t>
 elementwise_callable object computing the distance of its arguments.
 
constexpr auto eve::div = functor<div_t>
 elementwise_callable object computing the division of multiple values.
 
constexpr auto eve::dot = functor<dot_t>
 elementwise_callable object computing the elementwise dot product of the vector of the first half parameter by thevector of the last half.
 
constexpr auto eve::fdim = functor<fdim_t>
 elementwise_callable computing the positive difference between the two parameters.
 
constexpr auto eve::floor = functor<floor_t>
 elementwise_callable object computing the largest integer not greater than the input.
 
constexpr auto eve::fmod = functor<fmod_t>
 elementwise_callable object mimicking the std::fmod function for floating values.
 
constexpr auto eve::frac = functor<frac_t>
 elementwise_callable computing the fractional part of the input.
 
constexpr auto eve::fracscale = functor<fracscale_t>
 strict_elementwise_callable object computing the reduced part of the scaled input.
 
constexpr auto eve::heaviside = functor<heaviside_t>
 elementwise_callable that return 1 if the input is greater than a threshold else 0.
 
constexpr auto eve::inc = functor<inc_t>
 elementwise_callable object returning the input incremented by 1.
 
constexpr auto eve::lerp = functor<lerp_t>
 Computes the linear interpolation.
 
constexpr auto eve::manhattan = functor<manhattan_t>
 tuple_callable object computing the manhattan norm ( \(l_1\)) of its arguments.
 
constexpr auto eve::max = functor<max_t>
 Computes the maximum of its arguments.
 
constexpr auto eve::maxabs = functor<maxabs_t>
 Computes the maximum of the absolute value norm ( \(l_\infty\)) of its arguments.
 
constexpr auto eve::maxmag = functor<maxmag_t>
 Computes the value for which the maximum of the absolute value of its arguments is obtained.
 
constexpr auto eve::min = functor<min_t>
 Computes the minimum of its arguments.
 
constexpr auto eve::minabs = functor<minabs_t>
 Computes the minimum of the absolute value of its arguments.
 
constexpr auto eve::minmag = functor<minmag_t>
 Computes the value for which the minimum of the absolute value of its arguments is obtained.
 
constexpr auto eve::minmax = functor<minmax_t>
 Computes the minimum and maximum of its arguments.
 
constexpr auto eve::minus = functor<minus_t>
 Computes the opposite of the parameter that must be signed.
 
constexpr auto eve::modf = functor<modf_t>
 elementwise_callable object computing the elementwise pair of fractional and integral parts of the value,
 
constexpr auto eve::mul = functor<mul_t>
 tuple_callable computing the product of its arguments.
 
constexpr auto eve::nearest = functor<nearest_t>
 strict_elementwise_callable object computing the nearest integer to the input.
 
constexpr auto eve::negabsmax = functor<negabsmax_t>
 tuple_callable computing the absolute value of the maximal element.
 
constexpr auto eve::negabsmin = functor<negabsmin_t>
 tuple_callable computing the absolute value of the minimal element.
 
constexpr auto eve::negate = functor<negate_t>
 elementwise_callable object computing the product of the first parameter by the sign of the second.
 
constexpr auto eve::negatenz = functor<negatenz_t>
 elementwise_callable object computing the product of the first parameter by the never zero sign of the second.
 
constexpr auto eve::negmaxabs = functor<negmaxabs_t>
 tuple_callable object computing the negated value of the element of maximal absolute value.
 
constexpr auto eve::negminabs = functor<negminabs_t>
 tuple_callable computing the negated value of the element of minimal absolute value.
 
constexpr auto eve::oneminus = functor<oneminus_t>
 elementwise_callable computing the value of one minus the input.
 
constexpr auto eve::rat = functor<rat_t>
 elementwise_callable object computing a rational approximation.
 
constexpr auto eve::rec = functor<rec_t>
 Computes the inverse of the parameter.
 
constexpr auto eve::reldist = functor<reldist_t>
 elementwise_callable object computing the relative distance of its arguments.
 
constexpr auto eve::rem = functor<rem_t>
 elementwise_callable object computing the remainder after division.
 
constexpr auto eve::remainder = functor<remainder_t>
 mimick the std::remainder function for floating values.
 
constexpr auto eve::round = functor<round_t>
 Computes the integer nearest to the input.
 
constexpr auto eve::roundscale = functor<roundscale_t>
 strict_elementwise_callable object computing the scaled input rounding.
 
constexpr auto eve::rsqrt = functor<rsqrt_t>
 Computes the inverse of the square root of the parameter.
 
constexpr auto eve::saturate = functor<saturate_t>
 strict_elementwise_callable computing the saturation of a value in a type.
 
constexpr auto eve::sign = functor<sign_t>
 elementwise_callable object computing the sign of the parameter.
 
constexpr auto eve::sign_alternate = functor<sign_alternate_t>
 Computes \((-1)^n\).
 
constexpr auto eve::signnz = functor<signnz_t>
 elementwise_callable object computing the never zero sign of the parameter.
 
constexpr auto eve::sqr = functor<sqr_t>
 Computes the square of the parameter.
 
constexpr auto eve::sqrt = functor<sqrt_t>
 Computes the elementwise square root of the parameter.
 
constexpr auto eve::sub = functor<sub_t>
 tuple_callable computing the difference of its first argument with the sum of the others.
 
constexpr auto eve::sum_of_squares = functor<sum_of_squares_t>
 tuple_callable object computing the sum_of_squares norm ( \(l_1\)) of its arguments.
 
constexpr auto eve::trunc = functor<trunc_t>
 elementwise_callable object computing the integral part of x with the same sign as x.
 
constexpr auto eve::variance = functor<variance_t>
 tuple_callable computing the variance of its arguments.
 
constexpr auto eve::welford_average = functor<welford_average_t>
 tuple_callable computing the arithmetic mean of its arguments.
 
constexpr auto eve::welford_covariance = functor<welford_covariance_t>
 elementwise_callable object computing the elementwise welford_covariance product of the vector of the first half parameter by thevector of the last half.
 
constexpr auto eve::welford_variance = functor<welford_variance_t>
 tuple_callable computing the arithmetic mean of its arguments.