itpp::CFixed< w, e, o, q > Class Template Reference
Fixed-point Module

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

`#include <itpp/fixed/cfixed.h>`

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

## 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, 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, Stat *ptr=0)
| Constructor.
virtual | ~CFixed ()
| Destructor.
CFixed & | operator= (const CFix &x)
| Assignment from CFix.
CFixed & | operator= (const Fix &x)
| Assignment from Fix.
CFixed & | operator= (const std::complex< double > &x)
| Assignment from complex<double>. Fractional part is truncated.
CFixed & | operator= (int x)
| Assignment from int.
CFix & | operator+= (const CFix &x)
| Addition of CFix.
CFix & | operator+= (const Fix &x)
| Addition of Fix.
CFix & | operator+= (const int x)
| Addition of int.
CFix & | operator-= (const CFix &x)
| Subtraction of CFix.
CFix & | operator-= (const Fix &x)
| Subtraction of Fix.
CFix & | operator-= (const int x)
| Subtraction of int.
CFix & | operator*= (const CFix &x)
| Multiplication with CFix. Temporary variables use the maximum word length (64 bits).
CFix & | operator*= (const Fix &x)
| Multiplication with Fix. Temporary variables use the maximum word length (64 bits).
CFix & | operator*= (const int x)
| Multiplication with int. Temporary variables use the maximum word length (64 bits).
CFix & | operator/= (const CFix &x)
| Division with CFix using quantization mode `TRN`. Temporary variables use the maximum word length (64 bits).
CFix & | operator/= (const Fix &x)
| Division with Fix using quantization mode `TRN`. Temporary variables use the maximum word length (64 bits).
CFix & | operator/= (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.
CFix & | operator<<= (const int n)
| Left shift `n` bits.
CFix & | operator>>= (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< double > () 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
| Real data part.
fixrep | im
| Imaginary data part.
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.
Stat * | stat_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).

## 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 Module module.

Definition at line 50 of file cfixed.h.

## Constructor & Destructor Documentation

## CFixed() [1/5]

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 54 of file cfixed.h.

## CFixed() [2/5]

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 | ,
|  | int | s = 0,
|  | Stat * | ptr = 0 )

inline

Constructor.

Definition at line 57 of file cfixed.h.

## CFixed() [3/5]

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 60 of file cfixed.h.

## CFixed() [4/5]

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 63 of file cfixed.h.

## CFixed() [5/5]

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 | ,
|  | Stat * | ptr = 0 )

inline

Constructor.

Definition at line 66 of file cfixed.h.

## ~CFixed()

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 69 of file cfixed.h.

## Member Function Documentation

## operator=() [1/4]

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.

Definition at line 72 of file cfixed.h.

## operator=() [2/4]

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.

Definition at line 79 of file cfixed.h.

## operator=() [3/4]

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.

Definition at line 86 of file cfixed.h.

## operator=() [4/4]

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.

Definition at line 93 of file cfixed.h.

## operator+=() [1/3]

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

inherited

Addition of CFix.

Definition at line 70 of file cfix.cpp.

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

## operator+=() [2/3]

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

inherited

Addition of Fix.

Definition at line 78 of file cfix.cpp.

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

## operator+=() [3/3]

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

inherited

Addition of int.

Definition at line 85 of file cfix.cpp.

References CFix().

## operator-=() [1/3]

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

inherited

Subtraction of CFix.

Definition at line 92 of file cfix.cpp.

References CFix().

## operator-=() [2/3]

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

inherited

Subtraction of Fix.

Definition at line 100 of file cfix.cpp.

References CFix().

## operator-=() [3/3]

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

inherited

Subtraction of int.

Definition at line 107 of file cfix.cpp.

References CFix().

## operator*=() [1/3]

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

inherited

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

Definition at line 114 of file cfix.cpp.

References CFix().

## operator*=() [2/3]

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

inherited

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(), CFix(), im, re, itpp::Fix::re, and itpp::Fix_Base::shift.

## operator*=() [3/3]

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

inherited

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

Definition at line 131 of file cfix.cpp.

References CFix().

## operator/=() [1/3]

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 138 of file cfix.cpp.

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

## operator/=() [2/3]

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 148 of file cfix.cpp.

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

## operator/=() [3/3]

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 156 of file cfix.cpp.

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

## operator-()

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

inherited

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

inherited

Left shift `n` bits.

Definition at line 168 of file cfix.cpp.

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

## operator>>=()

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

inherited

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

Definition at line 177 of file cfix.cpp.

References CFix(), 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 )

inherited

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>>(), itpp::set_fix(), itpp::set_fix(), itpp::set_fix(), and itpp::set_fix().

## set() [2/4]

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

inherited

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

Definition at line 199 of file cfix.cpp.

References im, re, 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 )

inherited

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

Definition at line 206 of file cfix.cpp.

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

## set_re()

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 124 of file cfix.h.

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

Referenced by itpp::operator>>().

## set_im()

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 126 of file cfix.h.

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

Referenced by itpp::operator>>().

## lshift()

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

inherited

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

inherited

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(), and itpp::rshift_fix().

## rshift() [2/2]

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

inherited

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 inherited

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 inherited

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

Definition at line 138 of file cfix.h.

References re.

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

## get_im()

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 140 of file cfix.h.

References im.

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

## unfix()

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

inherited

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 inherited

Conversion to std::complex<double>.

Definition at line 146 of file cfix.h.

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

## set_shift()

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

inline inherited

Set shift (without shifting).

Definition at line 994 of file fix_base.h.

References shift.

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

## set_output_mode() [1/2]

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

static inherited

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

inline inherited

Get shift.

Definition at line 1001 of file fix_base.h.

References shift.

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

## get_wordlen()

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

inline inherited

Get word length.

Definition at line 1003 of file fix_base.h.

References wordlen.

## get_e_mode()

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

inline inherited

Get sign encoding mode.

Definition at line 1005 of file fix_base.h.

References emode.

## get_o_mode()

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

inline inherited

Get overflow mode.

Definition at line 1007 of file fix_base.h.

References omode.

## get_q_mode()

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

inline inherited

Get quantization mode.

Definition at line 1009 of file fix_base.h.

References qmode.

## get_output_mode()

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

inline inherited

Get output mode.

Definition at line 1011 of file fix_base.h.

Referenced by itpp::operator<<(), and itpp::operator<<().

## get_max()

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

inline inherited

Get maximum value of data representation.

Definition at line 1013 of file fix_base.h.

References max.

## get_min()

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

inline inherited

Get minimum value of data representation.

Definition at line 1015 of file fix_base.h.

References min.

## init()

void itpp::Fix_Base::init | ( |  | ) |

protected inherited

Calculate help variables min, max and n_unused_bits.

Definition at line 67 of file fix_base.cpp.

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

Referenced by Fix_Base(), and Fix_Base().

## apply_o_mode()

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 88 of file fix_base.cpp.

References it_error, max, min, n_unused_bits, omode, itpp::SAT, stat_ptr, and itpp::WRAP.

Referenced by itpp::CFix::lshift(), itpp::Fix::lshift(), itpp::CFix::operator*=(), itpp::CFix::operator+=(), itpp::CFix::operator+=(), itpp::Fix::operator+=(), itpp::Fix::operator+=(), itpp::Fix::operator-=(), itpp::Fix::operator-=(), itpp::CFix::operator/=(), itpp::CFix::operator/=(), itpp::CFix::operator<<=(), itpp::CFix::operator=(), itpp::CFix::operator=(), itpp::CFix::operator=(), itpp::CFix::operator=(), itpp::CFixed< 1, TC, WRAP >::operator=(), itpp::CFixed< 1, TC, WRAP >::operator=(), itpp::CFixed< 1, TC, WRAP >::operator=(), itpp::CFixed< 1, TC, WRAP >::operator=(), itpp::Fix::operator=(), itpp::Fix::operator=(), itpp::Fixed< 1, TC, WRAP >::operator=(), itpp::Fixed< 1, TC, WRAP >::operator=(), scale_and_apply_modes(), itpp::CFix::set_im(), itpp::CFix::set_re(), and itpp::Fix::set_re().

## scale_and_apply_modes() [1/2]

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 1044 of file fix_base.h.

References qmode, and scale_and_apply_modes().

Referenced by itpp::CFix::CFix(), itpp::CFix::CFix(), itpp::Fix::Fix(), scale_and_apply_modes(), itpp::CFix::set(), itpp::CFix::set(), itpp::CFix::set(), itpp::CFix::set(), itpp::Fix::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

protected inherited

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

Definition at line 128 of file fix_base.cpp.

References apply_o_mode(), itpp::DOUBLE_POW2, 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::round(), shift, itpp::TRN, and itpp::TRN_ZERO.

## rshift_and_apply_q_mode() [1/2]

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 1048 of file fix_base.h.

References qmode, and rshift_and_apply_q_mode().

Referenced by itpp::CFix::operator>>=(), itpp::Fix::operator>>=(), itpp::CFix::rshift(), itpp::CFix::rshift(), itpp::Fix::rshift(), itpp::Fix::rshift(), and 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

protected inherited

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, stat_ptr, itpp::TRN, and itpp::TRN_ZERO.

## Member Data Documentation

## re

fixrep itpp::CFix::re

protected inherited

Real data part.

Definition at line 161 of file cfix.h.

Referenced by assert_shifts, assert_shifts, assert_shifts, CFix(), CFix(), CFix(), CFix(), CFix(), CFix(), get_re(), lshift(), operator std::complex< double >(), operator*=(), operator+=(), operator+=(), operator-(), operator/=(), operator/=(), operator/=(), operator<<=(), operator=(), operator=(), operator=(), operator=(), itpp::CFixed< 1, TC, WRAP >::operator=(), operator>>=(), print(), rshift(), rshift(), set(), set(), set(), set(), set_re(), and unfix().

## im

fixrep itpp::CFix::im

protected inherited

Imaginary data part.

Definition at line 162 of file cfix.h.

Referenced by assert_shifts, assert_shifts, assert_shifts, CFix(), CFix(), CFix(), CFix(), CFix(), CFix(), get_im(), lshift(), operator std::complex< double >(), operator*=(), operator+=(), operator-(), operator/=(), operator/=(), operator/=(), operator<<=(), operator=(), operator=(), operator=(), operator=(), itpp::CFixed< 1, TC, WRAP >::operator=(), operator>>=(), print(), rshift(), rshift(), set(), set(), set(), set(), set_im(), and unfix().

## shift

int itpp::Fix_Base::shift

protected inherited

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

Definition at line 1021 of file fix_base.h.

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

## wordlen

int itpp::Fix_Base::wordlen

protected inherited

Word length.

Definition at line 1023 of file fix_base.h.

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

## emode

e_mode itpp::Fix_Base::emode

protected inherited

Sign encoding mode.

Definition at line 1025 of file fix_base.h.

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

## omode

o_mode itpp::Fix_Base::omode

protected inherited

Overflow mode.

Definition at line 1027 of file fix_base.h.

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

## qmode

q_mode itpp::Fix_Base::qmode

protected inherited

Quantization mode.

Definition at line 1029 of file fix_base.h.

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

## stat_ptr

Stat* itpp::Fix_Base::stat_ptr

protected inherited

Pointer to statistics object.

Definition at line 1031 of file fix_base.h.

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

## min

fixrep itpp::Fix_Base::min

protected inherited

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

Definition at line 1033 of file fix_base.h.

Referenced by apply_o_mode(), get_min(), init(), and print().

## max

fixrep itpp::Fix_Base::max

protected inherited

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

Definition at line 1035 of file fix_base.h.

Referenced by apply_o_mode(), get_max(), init(), and print().

## n_unused_bits

int itpp::Fix_Base::n_unused_bits

protected inherited

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

Definition at line 1037 of file fix_base.h.

Referenced by apply_o_mode(), init(), and print().

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

- itpp/fixed/cfixed.h

Generated on for IT++ by Doxygen 1.15.0