◆ is_equal
Callable object computing the equality predicate. Required header: Members Functions
template< value T, value U > auto operator()( T x, U y ) const noexcept requires compatible< T, U >;
Parameters
Return value Returns the logical value containing the elementwise equality test result between 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_equal Parameters
Return value A Callable object so that the expression — //! — Supported decorators
ExampleSee it live on Compiler Explorer #include <eve/function/is_equal.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float, eve::fixed<4>>;
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'
float xf = 1.0f;
float yf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
return 0;
}
constexpr callable_is_equal_ is_equal Callable object computing the equality predicate. Definition: is_equal.hpp:98 |