E.V.E
v2022.09.01

◆ proj

eve::proj = {}
inlineconstexpr

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;
Definition: value.hpp:31

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()
{
wide_ft ref = { 0.0f, 1.0f, eve::minf(eve::as(1.0f)), eve::inf(eve::as(1.0f))};
wide_ft imf = { eve::inf(eve::as(1.0f)), 0.0f, 1.0f, eve::nan(eve::as(1.0f))};
z_t z{ref, imf};
std::cout
<< "---- simd" << '\n'
<< "<- z = " << z << '\n'
<< "-> proj(z) = " << eve::proj(z) << '\n';
auto scz = eve::as_complex_t<float>(1,eve::inf(eve::as(1.0f)));
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