IT++ Logo
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
itpp::CFix Class Reference

Complex fixed-point data type. More...

#include <itpp/fixed/cfix.h>

Inheritance diagram for itpp::CFix:
itpp::Fix_Base itpp::CFixed< w, e, o, q >

Public Member Functions

 CFix (double r=0.0, double i=0.0, int s=0, int w=MAX_WORDLEN, e_mode e=TC, o_mode o=WRAP, q_mode q=TRN, Stat *ptr=0)
 Default constructor. More...
 
 CFix (std::complex< double > x, double, int s=0, int w=MAX_WORDLEN, e_mode e=TC, o_mode o=WRAP, q_mode q=TRN, Stat *ptr=0)
 Constructor. More...
 
 CFix (const Fix_Factory &f)
 Constructor. More...
 
 CFix (fixrep r, fixrep i, int s, int, int)
 Constructor for internal use. No restrictions are applied. The dummies help to avoid ambiguities. More...
 
 CFix (const Fix &r, const Fix &i=0.0, int w=MAX_WORDLEN, e_mode e=TC, o_mode o=WRAP, q_mode q=TRN, Stat *ptr=0)
 Constructor. More...
 
 CFix (const CFix &x, double, int w=MAX_WORDLEN, e_mode e=TC, o_mode o=WRAP, q_mode q=TRN, Stat *ptr=0)
 Copy constructor. More...
 
virtual ~CFix ()
 Destructor. More...
 
CFixoperator= (const CFix &x)
 Assignment from CFix. More...
 
CFixoperator= (const Fix &x)
 Assignment from Fix. More...
 
CFixoperator= (const std::complex< double > &x)
 Assignment from std::complex<double>. Fractional part is truncated. More...
 
CFixoperator= (const int x)
 Assignment from int. More...
 
CFixoperator+= (const CFix &x)
 Addition of CFix. More...
 
CFixoperator+= (const Fix &x)
 Addition of Fix. More...
 
CFixoperator+= (const int x)
 Addition of int. More...
 
CFixoperator-= (const CFix &x)
 Subtraction of CFix. More...
 
CFixoperator-= (const Fix &x)
 Subtraction of Fix. More...
 
CFixoperator-= (const int x)
 Subtraction of int. More...
 
CFixoperator*= (const CFix &x)
 Multiplication with CFix. Temporary variables use the maximum word length (64 bits) More...
 
CFixoperator*= (const Fix &x)
 Multiplication with Fix. Temporary variables use the maximum word length (64 bits) More...
 
CFixoperator*= (const int x)
 Multiplication with int. Temporary variables use the maximum word length (64 bits) More...
 
CFixoperator/= (const CFix &x)
 Division with CFix using quantization mode TRN. Temporary variables use the maximum word length (64 bits) More...
 
CFixoperator/= (const Fix &x)
 Division with Fix using quantization mode TRN. Temporary variables use the maximum word length (64 bits) More...
 
CFixoperator/= (const int x)
 Division with int using quantization mode TRN. Temporary variables use the maximum word length (64 bits) More...
 
CFix operator- () const
 Unary negative of CFix. More...
 
CFixoperator<<= (const int n)
 Left shift n bits. More...
 
CFixoperator>>= (const int n)
 Right shift n bits using quantization mode qmode (constructor argument) More...
 
void set (double real, double imag, int n)
 Set to (real + i*imag) * pow2(n) using quantization mode qmode (constructor argument) More...
 
void set (double real, double imag, int n, q_mode q)
 Set to (real + i*imag) * pow2(n) using quantization mode q (function argument) More...
 
void set (const std::complex< double > &x, int n)
 Set to x * pow2(n) using quantization mode qmode (constructor argument) More...
 
void set (const std::complex< double > &x, int n, q_mode q)
 Set to x * pow2(n) using quantization mode q (function argument) More...
 
void set_re (fixrep x)
 Set data representation for real part (mainly for internal use since it reveals the representation type) More...
 
void set_im (fixrep x)
 Set data representation for imaginary part (mainly for internal use since it reveals the representation type) More...
 
void lshift (int n)
 Left shift n bits. More...
 
void rshift (int n)
 Right shift n bits using quantization mode qmode (constructor argument) More...
 
void rshift (int n, q_mode q)
 Right shift n bits using quantization mode q (function argument) More...
 
virtual void print () const
 Print restrictions. More...
 
fixrep get_re () const
 Get data representation for real part (mainly for internal use since it reveals the representation type) More...
 
fixrep get_im () const
 Get data representation for imaginary part (mainly for internal use since it reveals the representation type) More...
 
std::complex< double > unfix () const
 Conversion to std::complex<double> More...
 
 operator std::complex< double > () const
 Conversion to std::complex<double> More...
 
void set_shift (int s)
 Set shift (without shifting) More...
 
int get_shift () const
 Get shift. More...
 
int get_wordlen () const
 Get word length. More...
 
e_mode get_e_mode () const
 Get sign encoding mode. More...
 
o_mode get_o_mode () const
 Get overflow mode. More...
 
q_mode get_q_mode () const
 Get quantization mode. More...
 
output_mode get_output_mode () const
 Get output mode. More...
 
fixrep get_max () const
 Get maximum value of data representation. More...
 
fixrep get_min () const
 Get minimum value of data representation. More...
 

Static Public Member Functions

static void set_output_mode (output_mode o)
 Set output mode to OUTPUT_FIX, OUTPUT_FIX_SHIFT, OUTPUT_FLOAT or OUTPUT_FLOAT_SHIFT. Static member function. More...
 
static void set_output_mode (std::string o)
 Set output mode to "OUTPUT_FIX", "OUTPUT_FIX_SHIFT", "OUTPUT_FLOAT" or "OUTPUT_FLOAT_SHIFT". Static member function. More...
 

Protected Member Functions

void init ()
 Calculate help variables min, max and n_unused_bits. More...
 
fixrep apply_o_mode (fixrep x) const
 Handle overflows using overflow mode omode and make call to statistics object (if any) More...
 
fixrep scale_and_apply_modes (double x) const
 Convert from double to fixrep using shift and quantization mode qmode, then call limit() More...
 
fixrep scale_and_apply_modes (double x, q_mode q) const
 Convert from double to fixrep using shift and quantization mode q, then call limit() More...
 
fixrep rshift_and_apply_q_mode (fixrep x, int n) const
 Right shift n bits using quantization mode qmode and make call to statistics object (if any) More...
 
fixrep rshift_and_apply_q_mode (fixrep x, int n, q_mode q) const
 Right shift n bits using quantization mode q and make call to statistics object (if any) More...
 

Protected Attributes

fixrep re
 Real data part. More...
 
fixrep im
 Imaginary data part. More...
 
int shift
 Accumulated bitshift (positive means left-shifted, negative means right-shifted) More...
 
int wordlen
 Word length. More...
 
e_mode emode
 Sign encoding mode. More...
 
o_mode omode
 Overflow mode. More...
 
q_mode qmode
 Quantization mode. More...
 
Statstat_ptr
 Pointer to statistics object. More...
 
fixrep min
 Minimum allowed value (help variable to speed up calculations) More...
 
fixrep max
 Maximum allowed value (help variable to speed up calculations) More...
 
int n_unused_bits
 Number of unused (MSB) bits (help variable to speed up calculations) More...
 

Friends

template<int , e_mode , o_mode , q_mode >
class CFixed
 
ITPP_EXPORT int assert_shifts (const CFix &x, const CFix &y)
 Check that x.shift==y.shift OR x==0 OR y==0 and return the shift (for the non-zero argument) More...
 
ITPP_EXPORT int assert_shifts (const CFix &x, const Fix &y)
 Check that x.shift==y.shift OR x==0 OR y==0 and return the shift (for the non-zero argument) More...
 
ITPP_EXPORT int assert_shifts (const CFix &x, int y)
 Check that x.shift==0 OR x==0 OR y==0 and return x.shift. More...
 

Detailed Description

Complex fixed-point data type.

See the Detailed Description in the Fixed-point Module module.

Definition at line 51 of file cfix.h.

Constructor & Destructor Documentation

◆ CFix() [1/6]

itpp::CFix::CFix ( double  r = 0.0,
double  i = 0.0,
int  s = 0,
int  w = MAX_WORDLEN,
e_mode  e = TC,
o_mode  o = WRAP,
q_mode  q = TRN,
Stat ptr = 0 
)
inline

Default constructor.

Definition at line 56 of file cfix.h.

Referenced by operator-().

◆ CFix() [2/6]

itpp::CFix::CFix ( std::complex< double >  x,
double  ,
int  s = 0,
int  w = MAX_WORDLEN,
e_mode  e = TC,
o_mode  o = WRAP,
q_mode  q = TRN,
Stat ptr = 0 
)
inline

Constructor.

Definition at line 59 of file cfix.h.

◆ CFix() [3/6]

itpp::CFix::CFix ( const Fix_Factory f)
inlineexplicit

Constructor.

Definition at line 62 of file cfix.h.

◆ CFix() [4/6]

itpp::CFix::CFix ( fixrep  r,
fixrep  i,
int  s,
int  ,
int   
)
inline

Constructor for internal use. No restrictions are applied. The dummies help to avoid ambiguities.

Definition at line 65 of file cfix.h.

◆ CFix() [5/6]

itpp::CFix::CFix ( const Fix r,
const Fix i = 0.0,
int  w = MAX_WORDLEN,
e_mode  e = TC,
o_mode  o = WRAP,
q_mode  q = TRN,
Stat ptr = 0 
)
inline

Constructor.

Definition at line 68 of file cfix.h.

◆ CFix() [6/6]

itpp::CFix::CFix ( const CFix x,
double  ,
int  w = MAX_WORDLEN,
e_mode  e = TC,
o_mode  o = WRAP,
q_mode  q = TRN,
Stat ptr = 0 
)
inline

Copy constructor.

Definition at line 71 of file cfix.h.

◆ ~CFix()

virtual itpp::CFix::~CFix ( )
inlinevirtual

Destructor.

Definition at line 74 of file cfix.h.

Member Function Documentation

◆ operator=() [1/4]

CFix & itpp::CFix::operator= ( const CFix x)

Assignment from CFix.

Definition at line 38 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, re, and itpp::Fix_Base::shift.

◆ operator=() [2/4]

CFix & itpp::CFix::operator= ( const Fix x)

Assignment from Fix.

Definition at line 46 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, re, itpp::Fix::re, and itpp::Fix_Base::shift.

◆ operator=() [3/4]

CFix & itpp::CFix::operator= ( const std::complex< double > &  x)

Assignment from std::complex<double>. Fractional part is truncated.

Definition at line 54 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, itpp::imag(), re, itpp::real(), and itpp::Fix_Base::shift.

◆ operator=() [4/4]

CFix & itpp::CFix::operator= ( const int  x)

Assignment from int.

Definition at line 62 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, re, and itpp::Fix_Base::shift.

◆ operator+=() [1/3]

CFix & itpp::CFix::operator+= ( const CFix x)

Addition of CFix.

Definition at line 70 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), assert_shifts, im, re, and itpp::Fix_Base::shift.

◆ operator+=() [2/3]

CFix & itpp::CFix::operator+= ( const Fix x)

Addition of Fix.

Definition at line 78 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), assert_shifts, re, itpp::Fix::re, and itpp::Fix_Base::shift.

◆ operator+=() [3/3]

CFix & itpp::CFix::operator+= ( const int  x)

Addition of int.

Definition at line 85 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), assert_shifts, and re.

◆ operator-=() [1/3]

CFix & itpp::CFix::operator-= ( const CFix x)

Subtraction of CFix.

Definition at line 92 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), assert_shifts, im, re, and itpp::Fix_Base::shift.

◆ operator-=() [2/3]

CFix & itpp::CFix::operator-= ( const Fix x)

Subtraction of Fix.

Definition at line 100 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), assert_shifts, re, itpp::Fix::re, and itpp::Fix_Base::shift.

◆ operator-=() [3/3]

CFix & itpp::CFix::operator-= ( const int  x)

Subtraction of int.

Definition at line 107 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), assert_shifts, and re.

◆ operator*=() [1/3]

CFix & itpp::CFix::operator*= ( const CFix x)

Multiplication with CFix. Temporary variables use the maximum word length (64 bits)

Definition at line 114 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, re, and itpp::Fix_Base::shift.

◆ operator*=() [2/3]

CFix & itpp::CFix::operator*= ( const Fix x)

Multiplication with Fix. Temporary variables use the maximum word length (64 bits)

Definition at line 123 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, re, itpp::Fix::re, and itpp::Fix_Base::shift.

◆ operator*=() [3/3]

CFix & itpp::CFix::operator*= ( const int  x)

Multiplication with int. Temporary variables use the maximum word length (64 bits)

Definition at line 131 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, and re.

◆ operator/=() [1/3]

CFix & itpp::CFix::operator/= ( const CFix x)

Division with CFix using quantization mode TRN. Temporary variables use the maximum word length (64 bits)

Definition at line 138 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, re, and itpp::Fix_Base::shift.

◆ operator/=() [2/3]

CFix & itpp::CFix::operator/= ( const Fix x)

Division with Fix using quantization mode TRN. Temporary variables use the maximum word length (64 bits)

Definition at line 148 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, re, itpp::Fix::re, and itpp::Fix_Base::shift.

◆ operator/=() [3/3]

CFix & itpp::CFix::operator/= ( const int  x)

Division with int using quantization mode TRN. Temporary variables use the maximum word length (64 bits)

Definition at line 156 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, and re.

◆ operator-()

CFix itpp::CFix::operator- ( ) const

Unary negative of CFix.

Definition at line 163 of file cfix.cpp.

References CFix(), im, re, and itpp::Fix_Base::shift.

◆ operator<<=()

CFix & itpp::CFix::operator<<= ( const int  n)

Left shift n bits.

Definition at line 168 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, it_assert_debug, re, and itpp::Fix_Base::shift.

◆ operator>>=()

CFix & itpp::CFix::operator>>= ( const int  n)

Right shift n bits using quantization mode qmode (constructor argument)

Definition at line 177 of file cfix.cpp.

References im, re, itpp::Fix_Base::rshift_and_apply_q_mode(), and itpp::Fix_Base::shift.

◆ set() [1/4]

void itpp::CFix::set ( double  real,
double  imag,
int  n 
)

Set to (real + i*imag) * pow2(n) using quantization mode qmode (constructor argument)

Definition at line 185 of file cfix.cpp.

References im, itpp::imag(), re, itpp::real(), itpp::Fix_Base::scale_and_apply_modes(), and itpp::Fix_Base::shift.

Referenced by itpp::operator>>(), and itpp::set_fix().

◆ set() [2/4]

void itpp::CFix::set ( double  real,
double  imag,
int  n,
q_mode  q 
)

Set to (real + i*imag) * pow2(n) using quantization mode q (function argument)

Definition at line 192 of file cfix.cpp.

References im, itpp::imag(), re, itpp::real(), itpp::Fix_Base::scale_and_apply_modes(), and itpp::Fix_Base::shift.

◆ set() [3/4]

void itpp::CFix::set ( const std::complex< double > &  x,
int  n 
)

Set to x * pow2(n) using quantization mode qmode (constructor argument)

Definition at line 199 of file cfix.cpp.

References im, itpp::imag(), re, itpp::real(), itpp::Fix_Base::scale_and_apply_modes(), and itpp::Fix_Base::shift.

◆ set() [4/4]

void itpp::CFix::set ( const std::complex< double > &  x,
int  n,
q_mode  q 
)

Set to x * pow2(n) using quantization mode q (function argument)

Definition at line 206 of file cfix.cpp.

References im, itpp::imag(), re, itpp::real(), itpp::Fix_Base::scale_and_apply_modes(), and itpp::Fix_Base::shift.

◆ set_re()

void itpp::CFix::set_re ( fixrep  x)
inline

Set data representation for real part (mainly for internal use since it reveals the representation type)

Definition at line 124 of file cfix.h.

Referenced by itpp::operator>>().

◆ set_im()

void itpp::CFix::set_im ( fixrep  x)
inline

Set data representation for imaginary part (mainly for internal use since it reveals the representation type)

Definition at line 126 of file cfix.h.

Referenced by itpp::operator>>().

◆ lshift()

void itpp::CFix::lshift ( int  n)

Left shift n bits.

Definition at line 213 of file cfix.cpp.

References itpp::Fix_Base::apply_o_mode(), im, it_assert_debug, re, and itpp::Fix_Base::shift.

Referenced by itpp::lshift_fix().

◆ rshift() [1/2]

void itpp::CFix::rshift ( int  n)

Right shift n bits using quantization mode qmode (constructor argument)

Definition at line 221 of file cfix.cpp.

References im, re, itpp::Fix_Base::rshift_and_apply_q_mode(), and itpp::Fix_Base::shift.

Referenced by itpp::rshift_fix().

◆ rshift() [2/2]

void itpp::CFix::rshift ( int  n,
q_mode  q 
)

Right shift n bits using quantization mode q (function argument)

Definition at line 228 of file cfix.cpp.

References im, re, itpp::Fix_Base::rshift_and_apply_q_mode(), and itpp::Fix_Base::shift.

◆ print()

void itpp::CFix::print ( ) const
virtual

Print restrictions.

Reimplemented from itpp::Fix_Base.

Definition at line 242 of file cfix.cpp.

References im, itpp::Fix_Base::print(), and re.

◆ get_re()

fixrep itpp::CFix::get_re ( ) const
inline

Get data representation for real part (mainly for internal use since it reveals the representation type)

Definition at line 138 of file cfix.h.

Referenced by itpp::conj(), itpp::operator*(), itpp::operator+(), itpp::operator-(), itpp::operator/(), itpp::operator<<(), and itpp::real().

◆ get_im()

fixrep itpp::CFix::get_im ( ) const
inline

Get data representation for imaginary part (mainly for internal use since it reveals the representation type)

Definition at line 140 of file cfix.h.

Referenced by itpp::conj(), itpp::imag(), itpp::operator*(), itpp::operator+(), itpp::operator-(), itpp::operator/(), and itpp::operator<<().

◆ unfix()

std::complex< double > itpp::CFix::unfix ( ) const

Conversion to std::complex<double>

Definition at line 235 of file cfix.cpp.

References itpp::DOUBLE_POW2, im, it_assert_debug, re, and itpp::Fix_Base::shift.

Referenced by itpp::unfix().

◆ operator std::complex< double >()

itpp::CFix::operator std::complex< double > ( ) const
inline

Conversion to std::complex<double>

Definition at line 146 of file cfix.h.

References itpp::DOUBLE_POW2, and it_assert_debug.

◆ set_shift()

void itpp::Fix_Base::set_shift ( int  s)
inlineinherited

Set shift (without shifting)

Definition at line 994 of file fix_base.h.

Referenced by itpp::operator>>().

◆ set_output_mode() [1/2]

static void itpp::Fix_Base::set_output_mode ( output_mode  o)
inlinestaticinherited

Set output mode to OUTPUT_FIX, OUTPUT_FIX_SHIFT, OUTPUT_FLOAT or OUTPUT_FLOAT_SHIFT. Static member function.

Definition at line 996 of file fix_base.h.

Referenced by itpp::operator<<().

◆ set_output_mode() [2/2]

void itpp::Fix_Base::set_output_mode ( std::string  o)
staticinherited

Set output mode to "OUTPUT_FIX", "OUTPUT_FIX_SHIFT", "OUTPUT_FLOAT" or "OUTPUT_FLOAT_SHIFT". Static member function.

Definition at line 40 of file fix_base.cpp.

References it_error, itpp::OUTPUT_FIX, itpp::OUTPUT_FIX_SHIFT, itpp::OUTPUT_FLOAT, and itpp::OUTPUT_FLOAT_SHIFT.

◆ get_shift()

int itpp::Fix_Base::get_shift ( ) const
inlineinherited

◆ get_wordlen()

int itpp::Fix_Base::get_wordlen ( ) const
inlineinherited

Get word length.

Definition at line 1003 of file fix_base.h.

◆ get_e_mode()

e_mode itpp::Fix_Base::get_e_mode ( ) const
inlineinherited

Get sign encoding mode.

Definition at line 1005 of file fix_base.h.

◆ get_o_mode()

o_mode itpp::Fix_Base::get_o_mode ( ) const
inlineinherited

Get overflow mode.

Definition at line 1007 of file fix_base.h.

◆ get_q_mode()

q_mode itpp::Fix_Base::get_q_mode ( ) const
inlineinherited

Get quantization mode.

Definition at line 1009 of file fix_base.h.

◆ get_output_mode()

output_mode itpp::Fix_Base::get_output_mode ( ) const
inlineinherited

Get output mode.

Definition at line 1011 of file fix_base.h.

Referenced by itpp::operator<<().

◆ get_max()

fixrep itpp::Fix_Base::get_max ( ) const
inlineinherited

Get maximum value of data representation.

Definition at line 1013 of file fix_base.h.

References itpp::max().

◆ get_min()

fixrep itpp::Fix_Base::get_min ( ) const
inlineinherited

Get minimum value of data representation.

Definition at line 1015 of file fix_base.h.

References itpp::min().

◆ init()

void itpp::Fix_Base::init ( )
protectedinherited

◆ apply_o_mode()

fixrep itpp::Fix_Base::apply_o_mode ( fixrep  x) const
protectedinherited

◆ scale_and_apply_modes() [1/2]

fixrep itpp::Fix_Base::scale_and_apply_modes ( double  x) const
inlineprotectedinherited

Convert from double to fixrep using shift and quantization mode qmode, then call limit()

Definition at line 1044 of file fix_base.h.

References itpp::Fix_Base::scale_and_apply_modes().

Referenced by itpp::Fix_Base::scale_and_apply_modes(), set(), and itpp::Fix::set().

◆ scale_and_apply_modes() [2/2]

fixrep itpp::Fix_Base::scale_and_apply_modes ( double  x,
q_mode  q 
) const
protectedinherited

◆ rshift_and_apply_q_mode() [1/2]

fixrep itpp::Fix_Base::rshift_and_apply_q_mode ( fixrep  x,
int  n 
) const
inlineprotectedinherited

Right shift n bits using quantization mode qmode and make call to statistics object (if any)

Definition at line 1048 of file fix_base.h.

References itpp::Fix_Base::rshift_and_apply_q_mode().

Referenced by operator>>=(), itpp::Fix::operator>>=(), rshift(), itpp::Fix::rshift(), and itpp::Fix_Base::rshift_and_apply_q_mode().

◆ rshift_and_apply_q_mode() [2/2]

fixrep itpp::Fix_Base::rshift_and_apply_q_mode ( fixrep  x,
int  n,
q_mode  q 
) const
protectedinherited

Right shift n bits using quantization mode q and make call to statistics object (if any)

Definition at line 182 of file fix_base.cpp.

References it_assert_debug, it_error, itpp::RND, itpp::RND_CONV, itpp::RND_CONV_ODD, itpp::RND_INF, itpp::RND_MIN_INF, itpp::RND_ZERO, itpp::Stat::sample(), itpp::Fix_Base::stat_ptr, itpp::TRN, and itpp::TRN_ZERO.

Friends And Related Function Documentation

◆ CFixed

template<int , e_mode , o_mode , q_mode >
friend class CFixed
friend

Definition at line 53 of file cfix.h.

◆ assert_shifts [1/3]

ITPP_EXPORT int assert_shifts ( const CFix x,
const CFix y 
)
friend

Check that x.shift==y.shift OR x==0 OR y==0 and return the shift (for the non-zero argument)

Definition at line 249 of file cfix.cpp.

Referenced by operator+=(), and operator-=().

◆ assert_shifts [2/3]

ITPP_EXPORT int assert_shifts ( const CFix x,
const Fix y 
)
friend

Check that x.shift==y.shift OR x==0 OR y==0 and return the shift (for the non-zero argument)

Definition at line 265 of file cfix.cpp.

◆ assert_shifts [3/3]

ITPP_EXPORT int assert_shifts ( const CFix x,
int  y 
)
friend

Check that x.shift==0 OR x==0 OR y==0 and return x.shift.

Definition at line 281 of file cfix.cpp.

Member Data Documentation

◆ re

fixrep itpp::CFix::re
protected

◆ im

fixrep itpp::CFix::im
protected

◆ shift

int itpp::Fix_Base::shift
protectedinherited

◆ wordlen

int itpp::Fix_Base::wordlen
protectedinherited

Word length.

Definition at line 1023 of file fix_base.h.

Referenced by itpp::Fix_Base::init(), and itpp::Fix_Base::print().

◆ emode

e_mode itpp::Fix_Base::emode
protectedinherited

Sign encoding mode.

Definition at line 1025 of file fix_base.h.

Referenced by itpp::Fix_Base::init(), and itpp::Fix_Base::print().

◆ omode

o_mode itpp::Fix_Base::omode
protectedinherited

Overflow mode.

Definition at line 1027 of file fix_base.h.

Referenced by itpp::Fix_Base::apply_o_mode(), and itpp::Fix_Base::print().

◆ qmode

q_mode itpp::Fix_Base::qmode
protectedinherited

Quantization mode.

Definition at line 1029 of file fix_base.h.

Referenced by itpp::Fix_Base::print().

◆ stat_ptr

Stat* itpp::Fix_Base::stat_ptr
protectedinherited

Pointer to statistics object.

Definition at line 1031 of file fix_base.h.

Referenced by itpp::Fix_Base::apply_o_mode(), itpp::Fix_Base::print(), and itpp::Fix_Base::rshift_and_apply_q_mode().

◆ min

fixrep itpp::Fix_Base::min
protectedinherited

Minimum allowed value (help variable to speed up calculations)

Definition at line 1033 of file fix_base.h.

Referenced by itpp::Fix_Base::apply_o_mode(), itpp::Fix_Base::init(), and itpp::Fix_Base::print().

◆ max

fixrep itpp::Fix_Base::max
protectedinherited

Maximum allowed value (help variable to speed up calculations)

Definition at line 1035 of file fix_base.h.

Referenced by itpp::Fix_Base::apply_o_mode(), itpp::Fix_Base::init(), and itpp::Fix_Base::print().

◆ n_unused_bits

int itpp::Fix_Base::n_unused_bits
protectedinherited

Number of unused (MSB) bits (help variable to speed up calculations)

Definition at line 1037 of file fix_base.h.

Referenced by itpp::Fix_Base::apply_o_mode(), itpp::Fix_Base::init(), and itpp::Fix_Base::print().


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

Generated on Tue Aug 17 2021 10:59:15 for IT++ by Doxygen 1.9.4