NumericAL
A header-only C++20 lexer built on REAL
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
numerical::detail::cosine_line< R > Struct Template Reference

The cosine transforms of scipy.fft.dct, unscaled, on one line of n points by a Fourier transform: type 1 the real transform of the even extension (2(n − 1) points); type 2 the real transform of the points reordered evens then odds reversed, each frequency turned by roots (e^{−iπk/2n}), as Makhoul's; type 3 its inverse, by the inverse real transform; type 4 of an even n the complex transform of n/2 points, the even ones and the odd ones reversed paired and turned by roots (e^{−iπ(4j+1)/4n}), each frequency by turns (e^{−iπk/n}); of an odd n the complex transform of n points, 8n-th roots split as eighth roots times n-th ones (u n + 8 v = 1, as n is odd): the point 2j + 1 (mod n) the j-th times χ₈(2j + 1) + i χ₋₈(2j + 1), each value ±√2 (signs) times the real part of one frequency (picks), v (2k + 1) or its opposite (mod n), by those characters of u (2k + 1). More...

#include <fft.hpp>

Public Member Functions

template<bool Fused>
void apply (const R *u, R *y, R *even, std::complex< R > *spectrum, std::complex< R > *space) const
 y from u, even (the real transform's points) and spectrum its spaces, space the plan's; the path's products, Fused as its kernels' (fft_fuses), taken at each call, as a line is shared. Inlined into its caller, so that one built for FMA takes it whole (with_fma_instruction).
 

Public Attributes

int type {1}
 1 to 4.
 
std::size_t n {0}
 The points.
 
std::shared_ptr< const real_fft_plan< R > > real
 Types 1 to 3.
 
std::shared_ptr< const fft_plan< R > > complex
 Type 4.
 
std::vector< std::complex< R > > roots
 See above.
 
std::vector< std::complex< R > > turns
 Type 4 of an even n.
 
std::vector< std::size_t > picks
 Type 4 of an odd n: the frequency each value is.
 
std::vector< R > signs
 Its factor, ±√2.
 

Detailed Description

template<std::floating_point R>
struct numerical::detail::cosine_line< R >

The cosine transforms of scipy.fft.dct, unscaled, on one line of n points by a Fourier transform: type 1 the real transform of the even extension (2(n − 1) points); type 2 the real transform of the points reordered evens then odds reversed, each frequency turned by roots (e^{−iπk/2n}), as Makhoul's; type 3 its inverse, by the inverse real transform; type 4 of an even n the complex transform of n/2 points, the even ones and the odd ones reversed paired and turned by roots (e^{−iπ(4j+1)/4n}), each frequency by turns (e^{−iπk/n}); of an odd n the complex transform of n points, 8n-th roots split as eighth roots times n-th ones (u n + 8 v = 1, as n is odd): the point 2j + 1 (mod n) the j-th times χ₈(2j + 1) + i χ₋₈(2j + 1), each value ±√2 (signs) times the real part of one frequency (picks), v (2k + 1) or its opposite (mod n), by those characters of u (2k + 1).

Definition at line 3240 of file fft.hpp.

Member Function Documentation

◆ apply()

template<std::floating_point R>
template<bool Fused>
void numerical::detail::cosine_line< R >::apply ( const R *  u,
R *  y,
R *  even,
std::complex< R > *  spectrum,
std::complex< R > *  space 
) const
inline

y from u, even (the real transform's points) and spectrum its spaces, space the plan's; the path's products, Fused as its kernels' (fft_fuses), taken at each call, as a line is shared. Inlined into its caller, so that one built for FMA takes it whole (with_fma_instruction).

Definition at line 3255 of file fft.hpp.

Member Data Documentation

◆ complex

template<std::floating_point R>
std::shared_ptr<const fft_plan<R> > numerical::detail::cosine_line< R >::complex

Type 4.

Definition at line 3245 of file fft.hpp.

◆ n

template<std::floating_point R>
std::size_t numerical::detail::cosine_line< R >::n {0}

The points.

Definition at line 3243 of file fft.hpp.

◆ picks

template<std::floating_point R>
std::vector<std::size_t> numerical::detail::cosine_line< R >::picks

Type 4 of an odd n: the frequency each value is.

Definition at line 3248 of file fft.hpp.

◆ real

template<std::floating_point R>
std::shared_ptr<const real_fft_plan<R> > numerical::detail::cosine_line< R >::real

Types 1 to 3.

Definition at line 3244 of file fft.hpp.

◆ roots

template<std::floating_point R>
std::vector<std::complex<R> > numerical::detail::cosine_line< R >::roots

See above.

Definition at line 3246 of file fft.hpp.

◆ signs

template<std::floating_point R>
std::vector<R> numerical::detail::cosine_line< R >::signs

Its factor, ±√2.

Definition at line 3249 of file fft.hpp.

◆ turns

template<std::floating_point R>
std::vector<std::complex<R> > numerical::detail::cosine_line< R >::turns

Type 4 of an even n.

Definition at line 3247 of file fft.hpp.

◆ type

template<std::floating_point R>
int numerical::detail::cosine_line< R >::type {1}

1 to 4.

Definition at line 3242 of file fft.hpp.


The documentation for this struct was generated from the following file: