◆ fdim
Callable object computing the positive difference. Required header: Members Functions
template< real_value T, real_value U> auto operator()( T x, U y ) const noexcept
requires compatible< T, U >;
Parameters
Return value Returns the elementwise positive difference between
auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::fdim Parameters
Return value A Callable object so that the expression Supported decorators
ExampleSee it live on Compiler Explorer #include <eve/function/fdim.hpp>
#include <eve/wide.hpp>
#include <eve/constant/valmax.hpp>
#include <eve/constant/valmin.hpp>
#include <iostream>
using wide_it = eve::wide<float, eve::fixed<4>>;
int main()
{
wide_it pf = {0, 1, -1, -eve::valmax(eve::as<float>())};
wide_it qf = {1, -1, 0, eve::valmax(eve::as<float>())};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<< '\n';
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
<< '\n';
return 0;
}
constexpr callable_fdim_ fdim Callable object computing the positive difference. Definition: fdim.hpp:80 constexpr callable_valmax_ valmax Callable object computing the greatest representable value. Definition: valmax.hpp:53 |