E.V.E  0.1-beta

◆ minimum

eve::minimum = {}
inlineconstexpr

Callable object computing minimal element.

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

Members Functions

Member Effect
operator() computes the minimal 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 minimal element


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

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

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

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