#include <itpp/fixedpoint/fixed.h>
Inheritance diagram for itpp::Fixed< w, e, o, q >:

Public Member Functions | |
| Fixed (double x=0.0, int s=0, Stat *ptr=0) | |
| Default constructor. | |
| Fixed (Stat *ptr) | |
| Constructor. | |
| Fixed (const Fix &x, Stat *ptr=0) | |
| Constructor. | |
| virtual | ~Fixed () |
| Destructor. | |
| Fixed & | operator= (const Fix &x) |
| Assignment from Fix. | |
| Fixed & | operator= (int x) |
| Assignment from int. | |
| Fix & | operator+= (const Fix &x) |
| Addition of Fix. | |
| Fix & | operator+= (const int x) |
| Addition of int. | |
| Fix & | operator-= (const Fix &x) |
| Subtraction of Fix. | |
| Fix & | operator-= (const int x) |
| Subtraction of int. | |
| Fix & | operator *= (const Fix &x) |
| Multiplication with Fix. | |
| Fix & | operator *= (const int x) |
| Multiplication with int. | |
| Fix & | operator/= (const Fix &x) |
Division with Fix using quantization mode TRN. | |
| Fix & | operator/= (const int x) |
Division with int using quantization mode TRN. | |
| Fix | operator- () const |
| Unary negative of Fix. | |
| Fix & | operator<<= (const int n) |
Left shift n bits. | |
| Fix & | operator>>= (const int n) |
Right shift n bits using quantization mode qmode (constructor argument). | |
| void | set (double x, int n) |
Set to x * pow2(n) using quantization mode qmode (constructor argument). | |
| void | set (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 (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 (mainly for internal use since it reveals the representation type). | |
| double | unfix () const |
| Conversion to double. | |
| operator double () const | |
| Conversion to 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 | |
| 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. | |
| 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. | |
| 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). | |
Friends | |
| 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 Fix &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 Fix &x, int y) |
| Check that x.shift==0 OR x==0 OR y==0 and return x.shift. | |
See the Detailed Description in the Fixed-Point Data Types module.
Definition at line 50 of file fixed.h.
|
||||||||||||||||||||
|
Default constructor.
|
|
||||||||||
|
Constructor.
|
|
||||||||||||||||
|
Constructor.
|
|
|||||||||
|
Destructor.
|
|
||||||||||
|
Assignment from Fix.
Reimplemented from itpp::Fix. Definition at line 65 of file fixed.h. References itpp::Fix::re, and itpp::Fix_Base::shift. |
|
||||||||||
|
Assignment from int.
Reimplemented from itpp::Fix. |
|
|
Addition of Fix.
Definition at line 54 of file fix.cpp. References itpp::Fix_Base::apply_o_mode(), itpp::Fix::assert_shifts, and itpp::Fix::re. |
|
|
Addition of int.
Definition at line 61 of file fix.cpp. References itpp::Fix_Base::apply_o_mode(), itpp::Fix::assert_shifts, and itpp::Fix::re. |
|
|
Subtraction of Fix.
Definition at line 68 of file fix.cpp. References itpp::Fix_Base::apply_o_mode(), itpp::Fix::assert_shifts, and itpp::Fix::re. |
|
|
Subtraction of int.
Definition at line 75 of file fix.cpp. References itpp::Fix_Base::apply_o_mode(), itpp::Fix::assert_shifts, and itpp::Fix::re. |
|
|
Multiplication with Fix.
Definition at line 82 of file fix.cpp. References itpp::Fix_Base::apply_o_mode(), itpp::Fix::re, and itpp::Fix_Base::shift. |
|
|
Multiplication with int.
Definition at line 89 of file fix.cpp. References itpp::Fix_Base::apply_o_mode(), and itpp::Fix::re. |
|
|
Division with Fix using quantization mode
Definition at line 95 of file fix.cpp. References itpp::Fix_Base::apply_o_mode(), itpp::Fix::re, and itpp::Fix_Base::shift. |
|
|
Division with int using quantization mode
Definition at line 102 of file fix.cpp. References itpp::Fix_Base::apply_o_mode(), and itpp::Fix::re. |
|
|
Unary negative of Fix.
Definition at line 108 of file fix.cpp. References itpp::Fix::Fix(), and itpp::Fix::re. |
|
|
Left shift
Definition at line 113 of file fix.cpp. References itpp::Fix_Base::apply_o_mode(), it_assert1, and itpp::Fix::re. |
|
|
Right shift
Definition at line 121 of file fix.cpp. References itpp::Fix::re, and itpp::Fix_Base::rshift_and_apply_q_mode(). |
|
||||||||||||
|
Set to
Definition at line 128 of file fix.cpp. References itpp::Fix::re, and itpp::Fix_Base::scale_and_apply_modes(). Referenced by itpp::operator>>(). |
|
||||||||||||||||
|
Set to
Definition at line 134 of file fix.cpp. References itpp::Fix::re, and itpp::Fix_Base::scale_and_apply_modes(). |
|
|
Set data representation (mainly for internal use since it reveals the representation type).
Definition at line 106 of file fix.h. Referenced by itpp::operator>>(). |
|
|
Left shift
Definition at line 140 of file fix.cpp. References itpp::Fix_Base::apply_o_mode(), it_assert1, and itpp::Fix::re. |
|
|
Right shift
Definition at line 147 of file fix.cpp. References itpp::Fix::re, and itpp::Fix_Base::rshift_and_apply_q_mode(). |
|
||||||||||||
|
Right shift
Definition at line 153 of file fix.cpp. References itpp::Fix::re, and itpp::Fix_Base::rshift_and_apply_q_mode(). |
|
|
Print restrictions.
Reimplemented from itpp::Fix_Base. Definition at line 165 of file fix.cpp. References itpp::Fix::re. |
|
|
Get data representation (mainly for internal use since it reveals the representation type).
Definition at line 118 of file fix.h. References itpp::fixrep. Referenced by itpp::operator<<(). |
|
|
Conversion to double.
Definition at line 159 of file fix.cpp. References itpp::DOUBLE_POW2, it_assert1, and itpp::Fix::re. |
|
|
Conversion to double.
Definition at line 124 of file fix.h. References itpp::DOUBLE_POW2, and it_assert1. |
|
|
Set shift (without shifting).
Definition at line 1005 of file fix_base.h. Referenced by itpp::operator>>(). |
|
|
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. |
|
|
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. |
|
|
Get shift.
Definition at line 1012 of file fix_base.h. Referenced by itpp::operator<<(). |
|
|
Get word length.
Definition at line 1014 of file fix_base.h. |
|
|
Get sign encoding mode.
Definition at line 1016 of file fix_base.h. References itpp::e_mode. |
|
|
Get overflow mode.
Definition at line 1018 of file fix_base.h. References itpp::o_mode. |
|
|
Get quantization mode.
Definition at line 1020 of file fix_base.h. References itpp::q_mode. |
|
|
Get output mode.
Definition at line 1022 of file fix_base.h. References itpp::output_mode. |
|
|
Get maximum value of data representation.
Definition at line 1024 of file fix_base.h. References itpp::fixrep. |
|
|
Get minimum value of data representation.
Definition at line 1026 of file fix_base.h. References itpp::fixrep. |
|
|
Calculate help variables min, max and n_unused_bits.
Definition at line 70 of file fix_base.cpp. References itpp::fixrep, 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. |
|
|
Handle overflows using overflow mode
Definition at line 91 of file fix_base.cpp. References itpp::fixrep, itpp::int64, it_error, itpp::Fix_Base::n_unused_bits, 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::Fix::operator=(), itpp::CFix::operator=(), and itpp::Fix_Base::scale_and_apply_modes(). |
|
|
Convert from
Definition at line 1055 of file fix_base.h. References itpp::fixrep. Referenced by itpp::Fix::set(), and itpp::CFix::set(). |
|
||||||||||||
|
Convert from
Definition at line 131 of file fix_base.cpp. References itpp::Fix_Base::apply_o_mode(), itpp::DOUBLE_POW2, itpp::fixrep, 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. |
|
||||||||||||
|
Right shift
Definition at line 1059 of file fix_base.h. References itpp::fixrep. Referenced by itpp::Fix::operator>>=(), itpp::CFix::operator>>=(), itpp::Fix::rshift(), and itpp::CFix::rshift(). |
|
||||||||||||||||
|
Right shift
Definition at line 185 of file fix_base.cpp. References itpp::fixrep, 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. |
|
||||||||||||
|
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. Referenced by itpp::Fix::operator+=(), and itpp::Fix::operator-=(). |
|
||||||||||||
|
Check that x.shift==y.shift OR x==0 OR y==0 and return the shift (for the non-zero argument).
|
|
||||||||||||
|
Check that x.shift==0 OR x==0 OR y==0 and return x.shift.
|
|
|
|
Accumulated bitshift (positive means left-shifted, negative means right-shifted).
Definition at line 1032 of file fix_base.h. Referenced by 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::print(), and itpp::Fix_Base::scale_and_apply_modes(). |
|
|
Word length.
Definition at line 1034 of file fix_base.h. Referenced by itpp::Fix_Base::init(), and itpp::Fix_Base::print(). |
|
|
Sign encoding mode.
Definition at line 1036 of file fix_base.h. Referenced by itpp::Fix_Base::print(). |
|
|
Overflow mode.
Definition at line 1038 of file fix_base.h. Referenced by itpp::Fix_Base::print(). |
|
|
Quantization mode.
Definition at line 1040 of file fix_base.h. Referenced by itpp::Fix_Base::print(). |
|
|
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(). |
|
|
Minimum allowed value (help variable to speed up calculations).
Definition at line 1044 of file fix_base.h. Referenced by itpp::Fix_Base::init(), and itpp::Fix_Base::print(). |
|
|
Maximum allowed value (help variable to speed up calculations).
Definition at line 1046 of file fix_base.h. Referenced by itpp::Fix_Base::init(), and itpp::Fix_Base::print(). |
|
|
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(). |
Generated on Fri Jan 11 08:17:32 2008 for IT++ by Doxygen 1.3.9.1