E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ chi

auto eve::chi = functor<chi_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto chi(value auto x, value auto lo, value auto hi) noexcept; // 1
constexpr auto chi(value auto x, auto belongs) noexcept; // 2
// Lanes masking
constexpr auto chi[conditional_expr auto c](/*any of the above overloads*/) noexcept; // 3
constexpr auto chi[logical_value auto m](/*any of the above overloads*/) noexcept; // 3
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:132
The concept value<T> is satisfied if and only if T satisfies either eve::scalar_value or eve::simd_va...
Definition value.hpp:34
constexpr auto chi
callable indicatrix of the interval or of the set for which the invocable returns true.
Definition chi.hpp:90
constexpr auto lo
Computes the least significant half of each lane.
Definition lo.hpp:73
constexpr auto hi
elementwise_callable computing the most significant half of each lane.
Definition hi.hpp:71
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. Each element of the result contains:
    • 0, if x is less than lo. or if hi is strictly less than x.
    • 1 otherwise. 2 1 in the type of x if belongs(x) evaluate to true else 0.
  2. The operation is performed conditionnaly.
Note
If any lo is not less or equal to the corresponding hi the routine asserts.

External references

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
eve::wide x = {2.0, -3.0, 0.1, 4.0};
eve::wide lo = {3.0, -4.0, -10.0, 0.0};
eve::wide hi = {4.0, -1.0, 0.0, 5.0};
auto belongs = [](auto v) {return v > 3.0 || v == 2.0; };
std::cout << " <- x = " << x << '\n';
std::cout << " <- lo = " << lo << '\n';
std::cout << " <- hi = " << hi << '\n';
std::cout << " -> chi(x, belongs) = " << eve::chi(x, belongs) << '\n';
std::cout << " -> chi(x, lo, hi) = " << eve::chi(x, lo, hi) << '\n';
std::cout << " -> chi[x > -2](x, lo, hi) = " << eve::chi[x > -2](x, lo, hi) << '\n';
}
Wrapper for SIMD registers.
Definition wide.hpp:86