E.V.E  0.1-beta

◆ is_not_infinite

eve::is_not_infinite = {}
inlineconstexpr

Callable object computing the is_not_infinite logical value.

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

Members Functions

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

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

Parameters

x: value.

Return value

The call:

constexpr callable_is_not_infinite_ is_not_infinite
Callable object computing the is_not_infinite logical value.
Definition: is_not_infinite.hpp:84
Wrapper for SIMD compatible logical types.
Definition: logical.hpp:36

is semantically equivalent to:

if constexpr(floating_real_value<T>) r = is_not_equal(abs(x), inf(as(x));
else constexpr(integral_real_value<T>) r = false_(as(x));
Definition: value.hpp:103
Definition: value.hpp:113
constexpr callable_abs_ abs
Callable object computing the absolute value.
Definition: abs.hpp:91
constexpr callable_is_not_equal_ is_not_equal
Callable object computing the equality predicate.
Definition: is_not_equal.hpp:101
constexpr callable_false__ false_
Callable object computing the logical false_ value.
Definition: false.hpp:52
constexpr callable_inf_ inf
Callable object computing the infinity ieee value.
Definition: inf.hpp:54
Lightweight type-wrapper.
Definition: as.hpp:29

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

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

Parameters

cond : conditional expression

Return value

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

Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/is_not_infinite.hpp>
#include <eve/wide.hpp>
#include <eve/constant/inf.hpp>
#include <eve/constant/minf.hpp>
#include <eve/constant/nan.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.5f, -2.0f, -123.345f,
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> is_not_infinite(pf) = " << eve::is_not_infinite(pf) << '\n';
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> is_not_infinite(xf) = " << eve::is_not_infinite(xf) << '\n';
return 0;
}
constexpr callable_nan_ nan
Callable object computing the nan value.
Definition: nan.hpp:52
constexpr callable_minf_ minf
Callable object computing the negative infinity value.
Definition: minf.hpp:55
Wrapper for SIMD registers.
Definition: wide.hpp:65