E.V.E  0.1-beta

◆ is_eqz

eve::is_eqz = {}
inlineconstexpr

Callable object computing the equality to zero predicate.

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

Members Functions

Member Effect
operator() the equality to zero predicate
operator[] Construct a conditional version of current function object

auto operator()( value auto x ) const noexcept;
Definition: value.hpp:31

Parameters

x: values.

Return value

Returns the logical value containing the elementwise equality test result between x and 0.

The result type is logical< T >.


auto operator[]( conditional_expression auto cond ) const noexcept;

Higher-order function generating a masked version of eve::is_eqz

Parameters

cond : conditional expression

Return value

A Callable object so that the expression is_eqz[cond](x) is equivalent to if_else(cond,is_eqz(x),false(as(is_eqz(x))))


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/predicate.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.0f, -0.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> is_eqz(pf) = " << eve::is_eqz(pf) << '\n';
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> is_eqz(xf) = " << eve::is_eqz(xf) << '\n';
return 0;
}
constexpr callable_is_eqz_ is_eqz
Callable object computing the equality to zero predicate.
Definition: is_eqz.hpp:77
Wrapper for SIMD registers.
Definition: wide.hpp:65