E.V.E  0.1-beta

◆ binarize_not

eve::binarize_not = {}
inlineconstexpr

Callable object computing the binarize_not operation.

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

Members Functions

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

template< value T, scalar_value V > T operator()( Logical< T > c, V v = 1 ) const noexcept;

Parameters

c: logical value. v: scalar value defaulting to 1.

Return value

The call:

constexpr callable_binarize_not_ binarize_not
Callable object computing the binarize_not operation.
Definition: binarize_not.hpp:83
Wrapper for SIMD compatible logical types.
Definition: logical.hpp:36

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

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See 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>
int main()
{
wide_ft pf = { 0.0f, 1.0f, -1.0f, -0.5f};
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> binarize_not(pf > 0.0f) = " << eve::binarize_not(pf> 0.0f) << '\n'
<< "-> binarize_not(pf > 0.0f, 3) = " << eve::binarize_not(pf> 0.0f, 3) << '\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
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65