◆ binarize_not
Callable object computing the binarize_not operation. Required header: Members Functions
template< value T, scalar_value V > T operator()( Logical< T > c, V v = 1 ) const noexcept;
Parameters
Return value The call: logical<T> r = binarize_not(c,v);
constexpr callable_binarize_not_ binarize_not Callable object computing the binarize_not operation. Definition: binarize_not.hpp:83 is semantically equivalent to: T r = if_else(c, T(0), T(v));
constexpr callable_if_else_ if_else Callable object computing the if_else operation. Definition: if_else.hpp:99 auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::binarize_not Parameters
Return value A Callable object so that the expression Supported decoratorsno decorators are supported ExampleSee it live on Compiler Explorer #include <eve/function/binarize_not.hpp>
#include <eve/constant/false.hpp>
#include <eve/constant/true.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide <float, eve::fixed<4>>;
int main()
{
wide_ft pf = { 0.0f, 1.0f, -1.0f, -0.5f};
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
float xf = 1.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> binarize_not(true_(eve::as<float>()), xf) = " << eve::binarize_not(eve::true_(eve::as<float>()), xf) << '\n'
<< "-> binarize_not(false_(eve::as<float>()), xf) = " << eve::binarize_not(eve::false_(eve::as<float>()), xf) << '\n' ;
return 0;
}
constexpr callable_false__ false_ Callable object computing the logical false_ value. Definition: false.hpp:52 constexpr callable_true__ true_ Callable object computing the logical true_ value. Definition: true.hpp:52 |