E.V.E  0.1-beta

◆ all

eve::all = {}
inlineconstexpr

Callable object computing the all value.

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

Members Functions

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

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

Parameters

x: value.

Return value

A bool value which is true if and only if all elements of x are not zero.


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

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

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/all.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {-1.0f, 0.0f, -3.0f, -32768.0f};
wide_it qi = {-1.0f, 2.0f, -3.0f, -32768.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> all(pf) = " << eve::all(pf) << '\n'
<< "<- qi = " << qi << '\n'
<< "-> all(qi) = " << eve::all(qi) << '\n';
float xf = -0.0f;
float yf = -3.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> all(xf) = " << eve::all(xf) << '\n'
<< "<- yf = " << yf << '\n'
<< "-> all(yf) = " << eve::all(yf) << '\n';
return 0;
}
constexpr callable_all_ all
Callable object computing the all value.
Definition: all.hpp:72
Wrapper for SIMD registers.
Definition: wide.hpp:65