E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
chi
auto eve::chi =
functor
<chi_t>
inline
constexpr
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
}
eve::conditional_expr
Specifies that a type is a Conditional Expression.
Definition
conditional.hpp:28
eve::logical_value
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition
value.hpp:134
eve::value
The concept value<T> is satisfied if and only if T satisfies either eve::scalar_value or eve::simd_va...
Definition
value.hpp:34
eve::chi
constexpr auto chi
callable indicatrix of the interval or of the set for which the invocable returns true.
Definition
chi.hpp:90
eve::lo
constexpr auto lo
Computes the least significant half of each lane.
Definition
lo.hpp:73
eve::hi
constexpr auto hi
elementwise_callable computing the most significant half of each lane.
Definition
hi.hpp:71
eve
EVE Main Namespace.
Definition
abi.hpp:19
Parameters
x
: value to chi.
lo
,
hi
:
the boundary values
of the interval.
belongs
: predicate function
c
:
Conditional expression
masking the operation.
m
:
Logical value
masking the operation.
Return value
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.
The operation is performed conditionnaly
.
Note
If any
lo
is not less or equal to the corresponding
hi
the routine asserts.
External references
wikipedia
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'
;
}
eve::wide
Wrapper for SIMD registers.
Definition
wide.hpp:94
eve