NumericAL
A header-only C++20 lexer built on REAL
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
numerical::detail::unit_roots Class Reference

The roots e^{−2πi k/n} of one n, each as unit_root rounds it, from two tables of about √n angles instead of a series a root: the angle's share within its octant (reduce_to_octant) split as a + b·m, m the first table's length, and its cosine and sine those of the sum of the two tables' angles in double-double arithmetic, then placed by the octant and rounded once. The share 0 is the product of two exact (1, 0), so the exact roots stay exact, and a root and its mirror image share their share, so they stay each other's conjugates to the bit. More...

#include <fft.hpp>

Public Member Functions

 unit_roots (std::size_t n)
 The tables for the roots of n.
 
std::pair< double_double, double_double > parts (std::size_t k) const noexcept
 e^{−2πi k/n} as double-double parts: cos(A + B) = cA·cB − sA·sB, sin(A + B) = sA·cB + cA·sB.
 
std::complex< double > root (std::size_t k) const noexcept
 parts rounded once to double, a zero's sign positive.
 

Private Attributes

std::size_t n_
 The order of the roots.
 
std::size_t m_
 The first table's length.
 
std::vector< std::pair< double_double, double_double > > low_
 cos and sin of (π/4)·a/n, a below m.
 
std::vector< std::pair< double_double, double_double > > high_
 cos and sin of (π/4)·b·m/n, b·m up to n.
 

Detailed Description

The roots e^{−2πi k/n} of one n, each as unit_root rounds it, from two tables of about √n angles instead of a series a root: the angle's share within its octant (reduce_to_octant) split as a + b·m, m the first table's length, and its cosine and sine those of the sum of the two tables' angles in double-double arithmetic, then placed by the octant and rounded once. The share 0 is the product of two exact (1, 0), so the exact roots stay exact, and a root and its mirror image share their share, so they stay each other's conjugates to the bit.

Definition at line 244 of file fft.hpp.

Constructor & Destructor Documentation

◆ unit_roots()

numerical::detail::unit_roots::unit_roots ( std::size_t  n)
inlineexplicit

The tables for the roots of n.

Definition at line 249 of file fft.hpp.

Member Function Documentation

◆ parts()

std::pair< double_double, double_double > numerical::detail::unit_roots::parts ( std::size_t  k) const
inlinenoexcept

e^{−2πi k/n} as double-double parts: cos(A + B) = cA·cB − sA·sB, sin(A + B) = sA·cB + cA·sB.

Definition at line 262 of file fft.hpp.

◆ root()

std::complex< double > numerical::detail::unit_roots::root ( std::size_t  k) const
inlinenoexcept

parts rounded once to double, a zero's sign positive.

Definition at line 273 of file fft.hpp.

Member Data Documentation

◆ high_

std::vector<std::pair<double_double, double_double> > numerical::detail::unit_roots::high_
private

cos and sin of (π/4)·b·m/n, b·m up to n.

Definition at line 284 of file fft.hpp.

◆ low_

std::vector<std::pair<double_double, double_double> > numerical::detail::unit_roots::low_
private

cos and sin of (π/4)·a/n, a below m.

Definition at line 283 of file fft.hpp.

◆ m_

std::size_t numerical::detail::unit_roots::m_
private

The first table's length.

Definition at line 282 of file fft.hpp.

◆ n_

std::size_t numerical::detail::unit_roots::n_
private

The order of the roots.

Definition at line 281 of file fft.hpp.


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