◆ negate
Callable object computing the negate operation. Required header: Members Functions
Definition: value.hpp:31 Parameters
Return value Returns the elementwise product of the first parameter by the sign of the second. auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::negate Parameters
Return value A Callable object so that the expression Supported decoratorsno decorators are supported ExampleSee it live on Compiler Explorer #include <eve/function/negate.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float, eve::fixed<8>>;
int main()
{
wide_ft pf = {0.0f, -0.0f, 0.0f, -0.0f, 2.0f, -2.0f, 2.0f, 2.0f};
wide_ft qf = {4.0f, 4.0f, -4.0f, -4.0, 4.0f, 4.0f, -0.0f, +0.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
float xf = 4.0f;
float yf = -1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
return 0;
}
constexpr callable_negate_ negate Callable object computing the negate operation. Definition: negate.hpp:74 |