E.V.E  0.1-beta

◆ maximum

eve::maximum = {}
inlineconstexpr

Callable object computing maximal element.

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

Members Functions

Member Effect
operator() computes the maximal element of a real value
operator[] Construct a masked version of current function object

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

Parameters

x: a real value

Return value

returns a scalar value containing the maximal element


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

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

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/maximum.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {-1.0f, 2.0f, -3.0f, -68.0f};
wide_it pi = {-1, 2, -3268, 3};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> maximum(pf) = " << eve::maximum(pf) << '\n'
<< "<- pi = " << pi << '\n'
<< "-> maximum(pi) = " << eve::maximum(pi) << '\n';
return 0;
}
constexpr callable_pi_ pi
Callable object computing the value.
Definition: pi.hpp:54
constexpr callable_maximum_ maximum
Callable object computing maximal element.
Definition: maximum.hpp:71
Wrapper for SIMD registers.
Definition: wide.hpp:65