Callable object computing proj(x).
Required header: #include <eve/module/complex.hpp>
Members Functions
Member | Effect |
operator() | the computation of proj(x) |
auto operator()(
value auto x)
const noexcept;
Parameters
z
: value.
Return value complex type associted to z
For most z, std::proj(z)==z, but all complex infinities, even the numbers where one component is infinite and the other is NaN, become positive real infinity, (inf, 0.0) or (inf, -0.0). The sign of the imaginary (zero) component is the sign imag(z).
Example
#include <eve/module/complex.hpp>
#include <eve/wide.hpp>
#include <iostream>
using z_t = eve::as_complex_t<wide_ft>;
int main()
{
z_t z{ref, imf};
std::cout
<< "---- simd" << '\n'
<< "<- z = " << z << '\n'
std::cout
<< "---- scalar" << '\n'
<< "<- scz = " << scz << '\n'
<<
"-> proj(scz) = " <<
eve::proj(scz) <<
'\n';
return 0;
}
constexpr callable_proj_ proj
Callable object computing proj(x).
Definition: proj.hpp:53
constexpr callable_nan_ nan
Computes the IEEE NaN constant.
Definition: nan.hpp:53
constexpr callable_minf_ minf
Computes the -infinity ieee value.
Definition: minf.hpp:60
constexpr callable_inf_ inf
Computes the infinity ieee value.
Definition: inf.hpp:58
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65