E.V.E
v2022.03.00

◆ is_greater_equal

eve::is_greater_equal = {}
inlineconstexpr

Returns a logical true if and only if the element value of the first parameter is greater or equal to the second one.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T, eve::value U >
eve::as_logical<T> is_greater_equal(T x,U y) noexcept;
}
constexpr callable_is_greater_equal_ is_greater_equal
Returns a logical true if and only if the element value of the first parameter is greater or equal to...
Definition: is_greater_equal.hpp:81
Definition: all_of.hpp:22

Parameters

Return value

The call eve::is_greater_equal(x,y) is semantically equivalent to x >= y:

Example

#include <eve/module/core.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, -1.0f, -3.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<< "-> is_greater_equal(pf, qf) = " << eve::is_greater_equal(pf, qf) << '\n';
float xf = 1.0f;
float yf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
<< "-> is_greater_equal(xf, yf) = " << eve::is_greater_equal(xf, yf) << '\n';
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65

Semantic Modifiers

  • Masked Call

    The call eve;is_greater_equal[mask](x,y) provides a masked version of eve::is_greater_equal which is equivalent to if_else (mask, is_greater_equal(x), eve::false( eve::as(x,y))).

    Example

    #include <eve/module/core.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, -1.0f, -3.0f};
    std::cout << "---- simd" << '\n'
    << "<- pf = " << pf << '\n'
    << "<- qf = " << qf << '\n'
    << "-> is_greater_equal[pf > 0](pf, qf) = " << eve::is_greater_equal[pf > 0](pf, qf) << '\n';
    return 0;
    }

almost

The expression definitely(is_greater_equal)(x, y, t) where x and y must be floating point values, evals to true if and only if x is 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{prev}(y, t)\);
  • if t is omitted then the tolerance t default to 3*eps(as(x)).

Example

#include <eve/module/core.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, 3.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<< "-> almost(is_greater_equal)(pf, qf) = " << eve::almost(eve::is_greater_equal)(pf, qf) << '\n';
return 0;
}
constexpr almost_type const almost
Higher-order Callable Object imbuing a tolerant to little errors semantic onto other Callable Objects...
Definition: fuzzy.hpp:58