Skip to content

Complex functions

c32 typedef

c32 = complex<f32>

Alias for complex

Source code
using c32 = complex<f32>

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L193

c64 typedef

c64 = complex<f64>

Alias for complex

Source code
using c64 = complex<f64>

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L196

cabs function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
realtype<T1> cabs(const T1 &x)

Returns the absolute value (magnitude) of the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION realtype<T1> cabs(const T1& x)
{
    return intrinsics::cabs(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L250

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::cabs, E1> cabs(E1 &&x)

Returns template expression that returns the absolute value (magnitude) of the complex number x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::cabs, E1> cabs(E1&& x)
{
    return { fn::cabs(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L257

carg function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
realtype<T1> carg(const T1 &x)

Returns the phase angle (argument) of the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION realtype<T1> carg(const T1& x)
{
    return intrinsics::carg(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L264

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::carg, E1> carg(E1 &&x)

Returns template expression that returns the phase angle (argument) of the complex number x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::carg, E1> carg(E1&& x)
{
    return { fn::carg(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L271

cartesian function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 cartesian(const T1 &x)

Converts complex number to cartesian

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 cartesian(const T1& x)
{
    return intrinsics::cartesian(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L383

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::cartesian, E1>
cartesian(E1 &&x)

Returns template expression that converts complex number to cartesian

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::cartesian, E1> cartesian(E1&& x)
{
    return { fn::cartesian(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L390

cbase typedef

cbase = complex<fbase>

Alias for complex

Source code
using cbase = complex<fbase>

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L199

cconj function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 cconj(const T1 &x)

Returns the complex conjugate of the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_INTRINSIC T1 cconj(const T1& x)
{
    return intrinsics::cconj(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L430

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::cconj, E1> cconj(E1 &&x)

Returns template expression that returns the complex conjugate of the complex number x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::cconj, E1> cconj(E1&& x)
{
    return { fn::cconj(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L278

ccos function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 ccos(const T1 &x)

Returns the cosine of the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 ccos(const T1& x)
{
    return intrinsics::ccos(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L222

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::ccos, E1> ccos(E1 &&x)

Returns template expression that returns the cosine of the the complex value x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::ccos, E1> ccos(E1&& x)
{
    return { fn::ccos(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L229

ccosh function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 ccosh(const T1 &x)

Returns the hyperbolic cosine of the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 ccosh(const T1& x)
{
    return intrinsics::ccosh(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L236

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::ccosh, E1> ccosh(E1 &&x)

Returns template expression that returns the hyperbolic cosine of the the complex value x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::ccosh, E1> ccosh(E1&& x)
{
    return { fn::ccosh(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L243

cdupimag function

template <typename T, size_t N>
vec<complex<T>, N> cdupimag(const vec<complex<T>, N> &x)

Returns vector of complex values with imaginary part duplicated

Source code
template <typename T, size_t N>
KFR_INTRINSIC vec<complex<T>, N> cdupimag(const vec<complex<T>, N>& x)
{
    return ccomp(dupodd(cdecom(x)));
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L279

cdupreal function

template <typename T, size_t N>
vec<complex<T>, N> cdupreal(const vec<complex<T>, N> &x)

Returns vector of complex values with real part duplicated

Source code
template <typename T, size_t N>
KFR_INTRINSIC vec<complex<T>, N> cdupreal(const vec<complex<T>, N>& x)
{
    return ccomp(dupeven(cdecom(x)));
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L271

cexp function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 cexp(const T1 &x)

Returns \(e\) raised to the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 cexp(const T1& x)
{
    return intrinsics::cexp(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L327

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::cexp, E1> cexp(E1 &&x)

Returns template expression that returns \(e\) raised to the complex number x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::cexp, E1> cexp(E1&& x)
{
    return { fn::cexp(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L334

cexp10 function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 cexp10(const T1 &x)

Returns 10 raised to the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 cexp10(const T1& x)
{
    return intrinsics::cexp10(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L355

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::cexp10, E1> cexp10(E1 &&x)

Returns template expression that returns 10 raised to the complex number x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::cexp10, E1> cexp10(E1&& x)
{
    return { fn::cexp10(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L362

cexp2 function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 cexp2(const T1 &x)

Returns 2 raised to the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 cexp2(const T1& x)
{
    return intrinsics::cexp2(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L341

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::cexp2, E1> cexp2(E1 &&x)

Returns template expression that returns 2 raised to the complex number x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::cexp2, E1> cexp2(E1&& x)
{
    return { fn::cexp2(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L348

clog function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 clog(const T1 &x)

Returns the natural logarithm of the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 clog(const T1& x)
{
    return intrinsics::clog(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L285

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::clog, E1> clog(E1 &&x)

Returns template expression that returns the natural logarithm of the complex number x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::clog, E1> clog(E1&& x)
{
    return { fn::clog(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L292

clog10 function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 clog10(const T1 &x)

Returns the common (base-10) logarithm of the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 clog10(const T1& x)
{
    return intrinsics::clog10(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L313

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::clog10, E1> clog10(E1 &&x)

Returns template expression that returns the common (base-10) logarithm of the complex number x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::clog10, E1> clog10(E1&& x)
{
    return { fn::clog10(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L320

clog2 function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 clog2(const T1 &x)

Returns the binary (base-2) logarithm of the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 clog2(const T1& x)
{
    return intrinsics::clog2(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L299

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::clog2, E1> clog2(E1 &&x)

Returns template expression that returns the binary (base-2) logarithm of the complex number x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::clog2, E1> clog2(E1&& x)
{
    return { fn::clog2(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L306

cnegimag function

template <typename T, size_t N>
vec<complex<T>, N> cnegimag(const vec<complex<T>, N> &x)

Returns vector of complex values with imaginary part negated

Source code
template <typename T, size_t N>
KFR_INTRINSIC vec<complex<T>, N> cnegimag(const vec<complex<T>, N>& x)
{
    return x ^ complex<T>(T(), -T());
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L303

cnegreal function

template <typename T, size_t N>
vec<complex<T>, N> cnegreal(const vec<complex<T>, N> &x)

Returns vector of complex values with real part negated

Source code
template <typename T, size_t N>
KFR_INTRINSIC vec<complex<T>, N> cnegreal(const vec<complex<T>, N>& x)
{
    return x ^ complex<T>(-T(), T());
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L295

complex

complex class

template <typename T> complex

Represents the complex numbers. If KFR_STD_COMPLEX is defined, then kfr::complex is an alias for std::complex.

Source code
template <typename T>
struct complex
{
    static_assert(is_simd_type<T>::value, "Incorrect type for complex");
    constexpr static bool is_pod     = true;
    constexpr complex() CMT_NOEXCEPT = default;
    KFR_MEM_INTRINSIC constexpr complex(T re) CMT_NOEXCEPT : re(re), im(0) {}
    KFR_MEM_INTRINSIC constexpr complex(T re, T im) CMT_NOEXCEPT : re(re), im(im) {}
    constexpr complex(const complex&) CMT_NOEXCEPT = default;
    constexpr complex(complex&&) CMT_NOEXCEPT      = default;
    template <typename U>
    KFR_MEM_INTRINSIC constexpr complex(const complex<U>& other) CMT_NOEXCEPT : re(static_cast<T>(other.re)),
                                                                                im(static_cast<T>(other.im))
    {
    }
    template <typename U>
    KFR_MEM_INTRINSIC constexpr complex(complex<U>&& other) CMT_NOEXCEPT : re(std::move(other.re)),
                                                                           im(std::move(other.im))
    {
    }
#ifdef CMT_COMPILER_GNU
    constexpr complex& operator=(const complex&) CMT_NOEXCEPT = default;
    constexpr complex& operator=(complex&&) CMT_NOEXCEPT = default;
#else
    complex& operator=(const complex&) = default;
    complex& operator=(complex&&) = default;
#endif
    KFR_MEM_INTRINSIC constexpr const T& real() const CMT_NOEXCEPT { return re; }
    KFR_MEM_INTRINSIC constexpr const T& imag() const CMT_NOEXCEPT { return im; }
    KFR_MEM_INTRINSIC constexpr void real(T value) CMT_NOEXCEPT { re = value; }
    KFR_MEM_INTRINSIC constexpr void imag(T value) CMT_NOEXCEPT { im = value; }
    T re;
    T im;
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L53

csin function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 csin(const T1 &x)

Returns the sine of the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 csin(const T1& x)
{
    return intrinsics::csin(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L194

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::csin, E1> csin(E1 &&x)

Returns template expression that returns the sine of the the complex value x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::csin, E1> csin(E1&& x)
{
    return { fn::csin(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L201

csinh function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 csinh(const T1 &x)

Returns the hyperbolic sine of the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 csinh(const T1& x)
{
    return intrinsics::csinh(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L208

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::csinh, E1> csinh(E1 &&x)

Returns template expression that returns the hyperbolic sine of the complex number x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::csinh, E1> csinh(E1&& x)
{
    return { fn::csinh(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L215

csqrt function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 csqrt(const T1 &x)

Returns square root of the complex number x

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 csqrt(const T1& x)
{
    return intrinsics::csqrt(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L397

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::csqrt, E1> csqrt(E1 &&x)

Returns template expression that returns square root of the complex number x

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::csqrt, E1> csqrt(E1&& x)
{
    return { fn::csqrt(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L404

cswapreim function

template <typename T, size_t N>
vec<complex<T>, N> cswapreim(const vec<complex<T>, N> &x)

Returns vector of complex values with real and imaginary parts swapped

Source code
template <typename T, size_t N>
KFR_INTRINSIC vec<complex<T>, N> cswapreim(const vec<complex<T>, N>& x)
{
    return ccomp(swap<2>(cdecom(x)));
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L287

imag function

template <typename T>
constexpr T imag(const complex<T> &value)

Returns the imaginary part of the complex value

Source code
template <typename T>
constexpr KFR_INTRINSIC T imag(const complex<T>& value)
{
    return value.imag();
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L384

template <typename T, size_t N>
constexpr vec<T, N> imag(const vec<complex<T>, N> &value)

Returns the imaginary part of the complex value

Source code
template <typename T, size_t N>
constexpr KFR_INTRINSIC vec<T, N> imag(const vec<complex<T>, N>& value)
{
    return odd(cdecom(value));
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L391

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::imag, E1> imag(E1 &&x)

Returns the imaginary part of the complex value

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_INTRINSIC internal::expression_function<fn::imag, E1> imag(E1&& x)
{
    return { {}, std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L399

make_complex function

template <typename T1, typename T2 = T1, size_t N,
          typename T = common_type<T1, T2>>
constexpr vec<complex<T>, N>
make_complex(const vec<T1, N> &real,
             const vec<T2, N> &imag = T2(0))

Constructs complex value from real and imaginary parts

Source code
template <typename T1, typename T2 = T1, size_t N, typename T = common_type<T1, T2>>
constexpr KFR_INTRINSIC vec<complex<T>, N> make_complex(const vec<T1, N>& real,
                                                        const vec<T2, N>& imag = T2(0))
{
    return ccomp(interleave(innercast<T>(real), innercast<T>(imag)));
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L406

template <typename T1, typename T2 = T1,
          typename T = common_type<T1, T2>>
constexpr complex<T> make_complex(T1 real, T2 imag = T2(0))

Constructs complex value from real and imaginary parts

Source code
template <typename T1, typename T2 = T1, typename T = common_type<T1, T2>>
constexpr KFR_INTRINSIC complex<T> make_complex(T1 real, T2 imag = T2(0))
{
    return complex<T>(innercast<T>(real), innercast<T>(imag));
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L414

polar function

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
T1 polar(const T1 &x)

Converts complex number to polar

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION T1 polar(const T1& x)
{
    return intrinsics::polar(x);
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L369

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::polar, E1> polar(E1 &&x)

Returns template expression that converts complex number to polar

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::polar, E1> polar(E1&& x)
{
    return { fn::polar(), std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/math/complex_math.hpp#L376

real function

template <typename T, KFR_ENABLE_IF(is_numeric<T>::value)>
constexpr T real(const T &value)

Returns the real part of the complex value

Source code
template <typename T, KFR_ENABLE_IF(is_numeric<T>::value)>
constexpr KFR_INTRINSIC T real(const T& value)
{
    return value;
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L349

template <typename T>
constexpr T real(const complex<T> &value)

Returns the real part of the complex value

Source code
template <typename T>
constexpr KFR_INTRINSIC T real(const complex<T>& value)
{
    return value.real();
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L356

template <typename T, size_t N>
constexpr vec<T, N> real(const vec<complex<T>, N> &value)

Returns the real part of the complex value

Source code
template <typename T, size_t N>
constexpr KFR_INTRINSIC vec<T, N> real(const vec<complex<T>, N>& value)
{
    return even(cdecom(value));
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L363

template <typename E1,
          KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::real, E1> real(E1 &&x)

Returns the real part of the complex value

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_INTRINSIC internal::expression_function<fn::real, E1> real(E1&& x)
{
    return { {}, std::forward<E1>(x) };
}

https://github.com/kfrlib/kfr/blob//include/kfr/simd/complex.hpp#L377


Auto-generated from sources, Revision , https://github.com/kfrlib/kfr/blob//include/kfr/