Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
sw::universal::cordic::detail Namespace Reference

Classes

struct  config
struct  tan_config
struct  hyperbolic_config
struct  linear_config
struct  generator
struct  generator< fixpnt< nbits, rbits, arithmetic, bt > >
struct  tables
struct  reduction
struct  linear_tables
struct  hyperbolic_tables
struct  ln2_reduction
struct  vectored
struct  magnitude
struct  split
struct  ln2_reduced

Functions

constexpr unsigned clog2 (unsigned v) noexcept
constexpr unsigned hyperbolic_steps (unsigned R) noexcept
template<typename G>
G atan_inverse (unsigned m)
template<typename G>
G atan_pow2 (unsigned i)
template<typename G>
G pi_over_4 ()
template<typename G>
G atanh_pow2 (unsigned i)
template<typename G>
G ln2_series ()
template<typename Work>
const tables< Work > & tables_of ()
template<typename Red>
const reduction< Red > & reduction_of ()
template<typename Work>
const linear_tables< Work > & linear_tables_of ()
template<typename Work>
const hyperbolic_tables< Work > & hyperbolic_tables_of ()
template<typename Red>
const ln2_reduction< Red > & ln2_reduction_of ()
template<coordinates m, typename Work>
void step (Work &x, Work &y, Work &z, unsigned i, const Work &alpha, bool up)
template<coordinates m, typename Work, std::size_t N>
void rotate (Work &x, Work &y, Work &z, unsigned n, const std::array< Work, N > &A)
template<coordinates m, typename Work, std::size_t N>
void vector (Work &x, Work &y, Work &z, unsigned n, const std::array< Work, N > &A)
template<typename Work>
void rotate_hyperbolic (Work &x, Work &y, Work &z, unsigned n, const hyperbolic_tables< Work > &T)
template<typename Work>
void vector_hyperbolic (Work &x, Work &y, Work &z, unsigned n, const hyperbolic_tables< Work > &T)
template<unsigned W, typename bt>
void round_shift (blockbinary< W, bt, BinaryNumberType::Signed > &raw, unsigned shift)
template<typename Target, bool saturate = (Target::arithmetic == Saturate), unsigned W, typename bt>
Target fit (const blockbinary< W, bt, BinaryNumberType::Signed > &rawIn, unsigned shift)
template<typename Vec, unsigned IN, typename bt>
vectored< Vec > vector_raw (const blockbinary< IN, bt, BinaryNumberType::Signed > &rx, const blockbinary< IN, bt, BinaryNumberType::Signed > &ry, unsigned n)
template<typename Fixed>
blockbinary< Fixed::nbits+2u, typename Fixed::BlockType, BinaryNumberType::Signed > widen (const Fixed &f)
constexpr unsigned clamp_iterations (unsigned n, unsigned maxN) noexcept
template<unsigned W, typename bt>
unsigned msb_of (const blockbinary< W, bt, BinaryNumberType::Signed > &a)
template<typename Lin, typename M>
Lin normalized (const M &a)
template<typename Target, bool saturate = (Target::arithmetic == Saturate), typename Lin>
Target scaled_fit (Lin v, int E, bool negative)
template<typename Rot, unsigned nbits, unsigned rbits, bool arithmetic, typename bt>
void circular_sincos (const fixpnt< nbits, rbits, arithmetic, bt > &theta, unsigned n, Rot &S, Rot &C)
template<unsigned W, typename bt>
int clamped_int (blockbinary< W, bt, BinaryNumberType::Signed > v, int limit)
template<typename Cfg, typename H, unsigned nbits, unsigned rbits, bool arithmetic, typename bt>
ln2_reduced< H > reduce_ln2 (const fixpnt< nbits, rbits, arithmetic, bt > &z, bool absolute, int limit)
template<typename H>
H times_ln2 (int e, unsigned halve=0)

Function Documentation

◆ atan_inverse()

template<typename G>
G sw::universal::cordic::detail::atan_inverse ( unsigned m)

◆ atan_pow2()

template<typename G>
G sw::universal::cordic::detail::atan_pow2 ( unsigned i)

◆ atanh_pow2()

template<typename G>
G sw::universal::cordic::detail::atanh_pow2 ( unsigned i)

◆ circular_sincos()

template<typename Rot, unsigned nbits, unsigned rbits, bool arithmetic, typename bt>
void sw::universal::cordic::detail::circular_sincos ( const fixpnt< nbits, rbits, arithmetic, bt > & theta,
unsigned n,
Rot & S,
Rot & C )

◆ clamp_iterations()

unsigned sw::universal::cordic::detail::clamp_iterations ( unsigned n,
unsigned maxN )
constexprnoexcept

◆ clamped_int()

template<unsigned W, typename bt>
int sw::universal::cordic::detail::clamped_int ( blockbinary< W, bt, BinaryNumberType::Signed > v,
int limit )

◆ clog2()

unsigned sw::universal::cordic::detail::clog2 ( unsigned v)
constexprnoexcept

◆ fit()

template<typename Target, bool saturate = (Target::arithmetic == Saturate), unsigned W, typename bt>
Target sw::universal::cordic::detail::fit ( const blockbinary< W, bt, BinaryNumberType::Signed > & rawIn,
unsigned shift )

◆ hyperbolic_steps()

unsigned sw::universal::cordic::detail::hyperbolic_steps ( unsigned R)
constexprnoexcept

◆ hyperbolic_tables_of()

template<typename Work>
const hyperbolic_tables< Work > & sw::universal::cordic::detail::hyperbolic_tables_of ( )

◆ linear_tables_of()

template<typename Work>
const linear_tables< Work > & sw::universal::cordic::detail::linear_tables_of ( )

◆ ln2_reduction_of()

template<typename Red>
const ln2_reduction< Red > & sw::universal::cordic::detail::ln2_reduction_of ( )

◆ ln2_series()

template<typename G>
G sw::universal::cordic::detail::ln2_series ( )

◆ msb_of()

template<unsigned W, typename bt>
unsigned sw::universal::cordic::detail::msb_of ( const blockbinary< W, bt, BinaryNumberType::Signed > & a)

◆ normalized()

template<typename Lin, typename M>
Lin sw::universal::cordic::detail::normalized ( const M & a)

◆ pi_over_4()

template<typename G>
G sw::universal::cordic::detail::pi_over_4 ( )

◆ reduce_ln2()

template<typename Cfg, typename H, unsigned nbits, unsigned rbits, bool arithmetic, typename bt>
ln2_reduced< H > sw::universal::cordic::detail::reduce_ln2 ( const fixpnt< nbits, rbits, arithmetic, bt > & z,
bool absolute,
int limit )

◆ reduction_of()

template<typename Red>
const reduction< Red > & sw::universal::cordic::detail::reduction_of ( )

◆ rotate()

template<coordinates m, typename Work, std::size_t N>
void sw::universal::cordic::detail::rotate ( Work & x,
Work & y,
Work & z,
unsigned n,
const std::array< Work, N > & A )

◆ rotate_hyperbolic()

template<typename Work>
void sw::universal::cordic::detail::rotate_hyperbolic ( Work & x,
Work & y,
Work & z,
unsigned n,
const hyperbolic_tables< Work > & T )

◆ round_shift()

template<unsigned W, typename bt>
void sw::universal::cordic::detail::round_shift ( blockbinary< W, bt, BinaryNumberType::Signed > & raw,
unsigned shift )

◆ scaled_fit()

template<typename Target, bool saturate = (Target::arithmetic == Saturate), typename Lin>
Target sw::universal::cordic::detail::scaled_fit ( Lin v,
int E,
bool negative )

◆ step()

template<coordinates m, typename Work>
void sw::universal::cordic::detail::step ( Work & x,
Work & y,
Work & z,
unsigned i,
const Work & alpha,
bool up )

◆ tables_of()

template<typename Work>
const tables< Work > & sw::universal::cordic::detail::tables_of ( )

◆ times_ln2()

template<typename H>
H sw::universal::cordic::detail::times_ln2 ( int e,
unsigned halve = 0 )

◆ vector()

template<coordinates m, typename Work, std::size_t N>
void sw::universal::cordic::detail::vector ( Work & x,
Work & y,
Work & z,
unsigned n,
const std::array< Work, N > & A )

◆ vector_hyperbolic()

template<typename Work>
void sw::universal::cordic::detail::vector_hyperbolic ( Work & x,
Work & y,
Work & z,
unsigned n,
const hyperbolic_tables< Work > & T )

◆ vector_raw()

template<typename Vec, unsigned IN, typename bt>
vectored< Vec > sw::universal::cordic::detail::vector_raw ( const blockbinary< IN, bt, BinaryNumberType::Signed > & rx,
const blockbinary< IN, bt, BinaryNumberType::Signed > & ry,
unsigned n )

◆ widen()

template<typename Fixed>
blockbinary< Fixed::nbits+2u, typename Fixed::BlockType, BinaryNumberType::Signed > sw::universal::cordic::detail::widen ( const Fixed & f)