IT++ Logo Newcom Logo

itpp::CFixed< w, e, o, q > Class Template Reference
[Fixed-Point Data Types]

Templated complex fixed-point data type. More...

#include <itpp/fixedpoint/cfixed.h>

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

itpp::CFix itpp::Fix_Base List of all members.

Public Member Functions

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

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.
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.

Protected Member Functions

void init ()
 Calculate help variables min, max and n_unused_bits.
fixrep apply_o_mode (fixrep x) const
 Handle overflows using overflow mode omode and make call to statistics object (if any).
fixrep scale_and_apply_modes (double x) const
 Convert from double to fixrep using shift and quantization mode qmode, then call limit().
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().
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).
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).

Protected Attributes

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

Friends

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).
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).
int assert_shifts (const CFix &x, int y)
 Check that x.shift==0 OR x==0 OR y==0 and return x.shift.

Detailed Description

template<int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN>
class itpp::CFixed< w, e, o, q >

Templated complex fixed-point data type.

See the Detailed Description in the Fixed-Point Data Types module.

Definition at line 50 of file cfixed.h.


Constructor & Destructor Documentation

template<int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN>
itpp::CFixed< w, e, o, q >::CFixed ( double  r = 0.0,
double  i = 0.0,
int  s = 0,
Stat ptr = 0 
) [inline]

Default constructor.

Definition at line 53 of file cfixed.h.

template<int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN>
itpp::CFixed< w, e, o, q >::CFixed ( std::complex< double >  x,
double  dummy = 0.0,
int  s = 0,
Stat ptr = 0 
) [inline]

Constructor.

Definition at line 56 of file cfixed.h.

template<int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN>
itpp::CFixed< w, e, o, q >::CFixed ( Stat ptr  )  [inline, explicit]

Constructor.

Definition at line 59 of file cfixed.h.

template<int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN>
itpp::CFixed< w, e, o, q >::CFixed ( const Fix r,
const Fix i = 0.0,
Stat ptr = 0 
) [inline]

Constructor.

Definition at line 62 of file cfixed.h.

template<int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN>
itpp::CFixed< w, e, o, q >::CFixed ( const CFix x,
double  dummy = 0.0,
Stat ptr = 0 
) [inline]

Constructor.

Definition at line 65 of file cfixed.h.

template<int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN>
virtual itpp::CFixed< w, e, o, q >::~CFixed (  )  [inline, virtual]

Destructor.

Definition at line 68 of file cfixed.h.


Member Function Documentation

template<int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN>
CFixed& itpp::CFixed< w, e, o, q >::operator= ( const CFix x  )  [inline]

Assignment from CFix.

Reimplemented from itpp::CFix.

Definition at line 71 of file cfixed.h.

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

template<int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN>
CFixed& itpp::CFixed< w, e, o, q >::operator= ( const Fix x  )  [inline]

Assignment from Fix.

Reimplemented from itpp::CFix.

Definition at line 79 of file cfixed.h.

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

template<int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN>
CFixed& itpp::CFixed< w, e, o, q >::operator= ( const std::complex< double > &  x  )  [inline]

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

Reimplemented from itpp::CFix.

Definition at line 87 of file cfixed.h.

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

template<int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN>
CFixed& itpp::CFixed< w, e, o, q >::operator= ( int  x  )  [inline]

Assignment from int.

Reimplemented from itpp::CFix.

Definition at line 95 of file cfixed.h.

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

CFix & itpp::CFix::operator+= ( const CFix x  )  [inherited]

Addition of CFix.

Definition at line 72 of file cfix.cpp.

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

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

Addition of Fix.

Definition at line 80 of file cfix.cpp.

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

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

Addition of int.

Definition at line 87 of file cfix.cpp.

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

CFix & itpp::CFix::operator-= ( const CFix x  )  [inherited]

Subtraction of CFix.

Definition at line 94 of file cfix.cpp.

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

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

Subtraction of Fix.

Definition at line 102 of file cfix.cpp.

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

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

Subtraction of int.

Definition at line 109 of file cfix.cpp.

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

CFix & itpp::CFix::operator *= ( const CFix x  )  [inherited]

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

Definition at line 116 of file cfix.cpp.

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

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

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

Definition at line 125 of file cfix.cpp.

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

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

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

Definition at line 133 of file cfix.cpp.

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

CFix & itpp::CFix::operator/= ( const CFix x  )  [inherited]

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

Definition at line 140 of file cfix.cpp.

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

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

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

Definition at line 150 of file cfix.cpp.

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

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

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

Definition at line 158 of file cfix.cpp.

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

CFix itpp::CFix::operator- (  )  const [inherited]

Unary negative of CFix.

Definition at line 165 of file cfix.cpp.

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

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

Left shift n bits.

Definition at line 170 of file cfix.cpp.

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

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

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

Definition at line 179 of file cfix.cpp.

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

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

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

Definition at line 187 of file cfix.cpp.

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

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

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

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

Definition at line 194 of file cfix.cpp.

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

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

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

Definition at line 201 of file cfix.cpp.

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

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

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

Definition at line 208 of file cfix.cpp.

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

void itpp::CFix::set_re ( fixrep  x  )  [inline, inherited]

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

Definition at line 125 of file cfix.h.

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

Referenced by itpp::operator>>().

void itpp::CFix::set_im ( fixrep  x  )  [inline, inherited]

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

Definition at line 127 of file cfix.h.

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

Referenced by itpp::operator>>().

void itpp::CFix::lshift ( int  n  )  [inherited]

Left shift n bits.

Definition at line 215 of file cfix.cpp.

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

Referenced by itpp::lshift_fix().

void itpp::CFix::rshift ( int  n  )  [inherited]

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

Definition at line 223 of file cfix.cpp.

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

Referenced by itpp::rshift_fix().

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

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

Definition at line 230 of file cfix.cpp.

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

void itpp::CFix::print (  )  const [virtual, inherited]

Print restrictions.

Reimplemented from itpp::Fix_Base.

Definition at line 244 of file cfix.cpp.

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

fixrep itpp::CFix::get_re (  )  const [inline, inherited]

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

Definition at line 139 of file cfix.h.

References itpp::CFix::re.

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

fixrep itpp::CFix::get_im (  )  const [inline, inherited]

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

Definition at line 141 of file cfix.h.

References itpp::CFix::im.

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

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

Conversion to std::complex<double>.

Definition at line 237 of file cfix.cpp.

References itpp::DOUBLE_POW2, itpp::CFix::im, it_assert1, itpp::CFix::re, and itpp::Fix_Base::shift.

Referenced by itpp::unfix().

itpp::CFix::operator std::complex (  )  const [inline, inherited]

Conversion to std::complex<double>.

Definition at line 147 of file cfix.h.

References itpp::DOUBLE_POW2, itpp::CFix::im, it_assert1, itpp::CFix::re, and itpp::Fix_Base::shift.

void itpp::Fix_Base::set_shift ( int  s  )  [inline, inherited]

Set shift (without shifting).

Definition at line 1005 of file fix_base.h.

References itpp::Fix_Base::shift.

Referenced by itpp::operator>>().

static void itpp::Fix_Base::set_output_mode ( output_mode  o  )  [inline, static, inherited]

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

Definition at line 1007 of file fix_base.h.

Referenced by itpp::operator<<().

void itpp::Fix_Base::set_output_mode ( std::string  o  )  [static, inherited]

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

Definition at line 43 of file fix_base.cpp.

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

int itpp::Fix_Base::get_shift (  )  const [inline, inherited]

Get shift.

Definition at line 1012 of file fix_base.h.

References itpp::Fix_Base::shift.

Referenced by itpp::abs(), itpp::assert_fixshift(), itpp::conj(), itpp::imag(), itpp::operator *(), itpp::operator/(), itpp::operator<<(), and itpp::real().

int itpp::Fix_Base::get_wordlen (  )  const [inline, inherited]

Get word length.

Definition at line 1014 of file fix_base.h.

References itpp::Fix_Base::wordlen.

e_mode itpp::Fix_Base::get_e_mode (  )  const [inline, inherited]

Get sign encoding mode.

Definition at line 1016 of file fix_base.h.

References itpp::Fix_Base::emode.

o_mode itpp::Fix_Base::get_o_mode (  )  const [inline, inherited]

Get overflow mode.

Definition at line 1018 of file fix_base.h.

References itpp::Fix_Base::omode.

q_mode itpp::Fix_Base::get_q_mode (  )  const [inline, inherited]

Get quantization mode.

Definition at line 1020 of file fix_base.h.

References itpp::Fix_Base::qmode.

output_mode itpp::Fix_Base::get_output_mode (  )  const [inline, inherited]

Get output mode.

Definition at line 1022 of file fix_base.h.

Referenced by itpp::operator<<().

fixrep itpp::Fix_Base::get_max (  )  const [inline, inherited]

Get maximum value of data representation.

Definition at line 1024 of file fix_base.h.

References itpp::Fix_Base::max.

fixrep itpp::Fix_Base::get_min (  )  const [inline, inherited]

Get minimum value of data representation.

Definition at line 1026 of file fix_base.h.

References itpp::Fix_Base::min.

void itpp::Fix_Base::init (  )  [protected, inherited]

Calculate help variables min, max and n_unused_bits.

Definition at line 70 of file fix_base.cpp.

References itpp::Fix_Base::emode, it_assert1, it_error, itpp::Fix_Base::max, itpp::MAX_WORDLEN, itpp::Fix_Base::min, itpp::Fix_Base::n_unused_bits, itpp::TC, itpp::UINT64_POW2, itpp::US, and itpp::Fix_Base::wordlen.

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

fixrep itpp::Fix_Base::apply_o_mode ( fixrep  x  )  const [protected, inherited]

Handle overflows using overflow mode omode and make call to statistics object (if any).

Definition at line 91 of file fix_base.cpp.

References it_error, itpp::Fix_Base::max, itpp::Fix_Base::min, itpp::Fix_Base::n_unused_bits, itpp::Fix_Base::omode, itpp::Stat::sample(), itpp::SAT, itpp::Fix_Base::stat_ptr, and itpp::WRAP.

Referenced by itpp::Fix::lshift(), itpp::CFix::lshift(), itpp::Fix::operator *=(), itpp::CFix::operator *=(), itpp::Fix::operator+=(), itpp::CFix::operator+=(), itpp::Fix::operator-=(), itpp::CFix::operator-=(), itpp::Fix::operator/=(), itpp::CFix::operator/=(), itpp::Fix::operator<<=(), itpp::CFix::operator<<=(), itpp::Fixed< w, e, o, q >::operator=(), itpp::Fix::operator=(), itpp::CFixed< w, e, o, q >::operator=(), itpp::CFix::operator=(), itpp::Fix_Base::scale_and_apply_modes(), itpp::CFix::set_im(), itpp::Fix::set_re(), and itpp::CFix::set_re().

fixrep itpp::Fix_Base::scale_and_apply_modes ( double  x  )  const [inline, protected, inherited]

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

Definition at line 1055 of file fix_base.h.

References itpp::Fix_Base::qmode.

Referenced by itpp::Fix::set(), and itpp::CFix::set().

fixrep itpp::Fix_Base::scale_and_apply_modes ( double  x,
q_mode  q 
) const [protected, inherited]

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

Definition at line 131 of file fix_base.cpp.

References itpp::Fix_Base::apply_o_mode(), itpp::ceil(), itpp::DOUBLE_POW2, itpp::floor(), it_assert1, it_error, itpp::RND, itpp::RND_CONV, itpp::RND_CONV_ODD, itpp::RND_INF, itpp::RND_MIN_INF, itpp::RND_ZERO, itpp::round(), itpp::Fix_Base::shift, itpp::TRN, and itpp::TRN_ZERO.

fixrep itpp::Fix_Base::rshift_and_apply_q_mode ( fixrep  x,
int  n 
) const [inline, protected, inherited]

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

Definition at line 1059 of file fix_base.h.

References itpp::Fix_Base::qmode.

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

fixrep itpp::Fix_Base::rshift_and_apply_q_mode ( fixrep  x,
int  n,
q_mode  q 
) const [protected, inherited]

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

Definition at line 185 of file fix_base.cpp.

References it_assert1, 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

int assert_shifts ( const CFix x,
const CFix y 
) [friend, inherited]

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

Definition at line 251 of file cfix.cpp.

Referenced by itpp::CFix::operator+=(), and itpp::CFix::operator-=().

int assert_shifts ( const CFix x,
const Fix y 
) [friend, inherited]

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

Definition at line 267 of file cfix.cpp.

int assert_shifts ( const CFix x,
int  y 
) [friend, inherited]

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

Definition at line 283 of file cfix.cpp.


Member Data Documentation

fixrep itpp::CFix::re [protected, inherited]

Data representation.

Definition at line 164 of file cfix.h.

Referenced by itpp::assert_shifts(), itpp::CFix::get_re(), itpp::CFix::lshift(), itpp::CFix::operator *=(), itpp::CFix::operator std::complex(), itpp::CFix::operator+=(), itpp::CFix::operator-(), itpp::CFix::operator-=(), itpp::CFix::operator/=(), itpp::CFix::operator<<=(), itpp::CFixed< w, e, o, q >::operator=(), itpp::CFix::operator=(), itpp::CFix::operator>>=(), itpp::CFix::print(), itpp::CFix::rshift(), itpp::CFix::set(), itpp::CFix::set_re(), and itpp::CFix::unfix().

int itpp::Fix_Base::shift [protected, inherited]

Accumulated bitshift (positive means left-shifted, negative means right-shifted).

Definition at line 1032 of file fix_base.h.

Referenced by itpp::assert_shifts(), itpp::Fix_Base::get_shift(), itpp::Fix::lshift(), itpp::CFix::lshift(), itpp::Fix::operator *=(), itpp::CFix::operator *=(), itpp::Fix::operator double(), itpp::CFix::operator std::complex(), itpp::Fix::operator+=(), itpp::CFix::operator+=(), itpp::Fix::operator-(), itpp::CFix::operator-(), itpp::Fix::operator-=(), itpp::CFix::operator-=(), itpp::Fix::operator/=(), itpp::CFix::operator/=(), itpp::Fix::operator<<=(), itpp::CFix::operator<<=(), itpp::Fixed< w, e, o, q >::operator=(), itpp::Fix::operator=(), itpp::CFixed< w, e, o, q >::operator=(), itpp::CFix::operator=(), itpp::operator>>(), itpp::Fix::operator>>=(), itpp::CFix::operator>>=(), itpp::Fix_Base::print(), itpp::Fix::rshift(), itpp::CFix::rshift(), itpp::Fix_Base::scale_and_apply_modes(), itpp::Fix::set(), itpp::CFix::set(), itpp::Fix_Base::set_shift(), itpp::Fix::unfix(), and itpp::CFix::unfix().

int itpp::Fix_Base::wordlen [protected, inherited]

Word length.

Definition at line 1034 of file fix_base.h.

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

e_mode itpp::Fix_Base::emode [protected, inherited]

Sign encoding mode.

Definition at line 1036 of file fix_base.h.

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

o_mode itpp::Fix_Base::omode [protected, inherited]

Overflow mode.

Definition at line 1038 of file fix_base.h.

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

q_mode itpp::Fix_Base::qmode [protected, inherited]

Quantization mode.

Definition at line 1040 of file fix_base.h.

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

Stat* itpp::Fix_Base::stat_ptr [protected, inherited]

Pointer to statistics object.

Definition at line 1042 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().

fixrep itpp::Fix_Base::min [protected, inherited]

Minimum allowed value (help variable to speed up calculations).

Definition at line 1044 of file fix_base.h.

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

fixrep itpp::Fix_Base::max [protected, inherited]

Maximum allowed value (help variable to speed up calculations).

Definition at line 1046 of file fix_base.h.

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

int itpp::Fix_Base::n_unused_bits [protected, inherited]

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

Definition at line 1048 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 file:
SourceForge Logo

Generated on Sat Aug 25 23:41:05 2007 for IT++ by Doxygen 1.5.2