E.V.E  0.1-beta

◆ is_not_greater

eve::is_not_greater = {}
inlineconstexpr

Callable object computing the "not greater than" predicate.

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

Members Functions

Member Effect
operator() the "not greater than" predicate
operator[] Construct a conditional version of current function object

template< value T, value U > auto operator()( T x, U y ) const noexcept requires compatible< T, U >;

Parameters

x, y: values.

Return value

Returns the logical value containing the elementwise comparison test result between x and y.

The result type is the common compatible type of the two parameters.


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

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

Parameters

cond : conditional expression

Return value

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


Supported decorators

  • almost

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

    The expression almost(is_not_greater)(x, y, t) where x and y must be floating point values, evals to true if and only if and only if x is not almost greater than y. This means that:

    • if t is a floating_value then \((x < y + t \max(|x|, |y|))\)
    • if t is a positive integral_value then \((x < \mbox{next}(y, t)\);
    • if t is omitted then the tolerance t default to 3*eps(as(x)).

The result type is the common compatible type of the two parameters.

Example

See it live on Compiler Explorer

#include <eve/function/is_not_greater.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.0f, -2.0f};
wide_ft qf = {1.0f, -1.0f, 0.0f, -2.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<< "-> is_not_greater(pf, qf) = " << eve::is_not_greater(pf, qf) << '\n';
float xf = 1.0f;
float yf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
<< "-> is_not_greater(xf, yf) = " << eve::is_not_greater(xf, yf) << '\n';
return 0;
}
constexpr callable_is_not_greater_ is_not_greater
Callable object computing the "not greater than" predicate.
Definition: is_not_greater.hpp:89
Wrapper for SIMD registers.
Definition: wide.hpp:65