#include <itpp/fixedpoint/fix_base.h>
Inheritance diagram for itpp::Fix_Base:
Public Member Functions | |
Fix_Base (int s=0, int w=MAX_WORDLEN, e_mode e=TC, o_mode o=WRAP, q_mode q=TRN, Stat *ptr=0) | |
Default constructor. | |
Fix_Base (const Fix_Base &x) | |
Copy constructor. | |
virtual | ~Fix_Base () |
Destructor. | |
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. | |
virtual void | print () const |
Print restrictions. | |
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 | |
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). |
See the Detailed Description in the Fixed-Point Data Types module.
Definition at line 993 of file fix_base.h.
|
Default constructor.
Definition at line 996 of file fix_base.h. References init(). |
|
Copy constructor.
Definition at line 999 of file fix_base.h. References init(). |
|
Destructor.
Definition at line 1002 of file fix_base.h. |
|
Set shift (without shifting).
Definition at line 1005 of file fix_base.h. References shift. 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. 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 43 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.
Definition at line 1012 of file fix_base.h. References shift. Referenced by itpp::abs(), itpp::assert_fixshift(), itpp::conj(), itpp::imag(), itpp::operator *(), itpp::operator/(), itpp::operator<<(), and itpp::real(). |
|
Get word length.
Definition at line 1014 of file fix_base.h. References wordlen. |
|
Get sign encoding mode.
Definition at line 1016 of file fix_base.h. References emode. |
|
Get overflow mode.
Definition at line 1018 of file fix_base.h. References omode. |
|
Get quantization mode.
Definition at line 1020 of file fix_base.h. References qmode. |
|
Get output mode.
Definition at line 1022 of file fix_base.h. Referenced by itpp::operator<<(). |
|
Get maximum value of data representation.
Definition at line 1024 of file fix_base.h. References max. |
|
Get minimum value of data representation.
Definition at line 1026 of file fix_base.h. References min. |
|
Print restrictions.
Reimplemented in itpp::CFix, and itpp::Fix. Definition at line 57 of file fix_base.cpp. References emode, max, min, n_unused_bits, omode, qmode, shift, stat_ptr, and wordlen. Referenced by itpp::Fix::print(), and itpp::CFix::print(). |
|
Calculate help variables min, max and n_unused_bits.
Definition at line 70 of file fix_base.cpp. References emode, it_assert1, it_error, max, itpp::MAX_WORDLEN, min, n_unused_bits, itpp::TC, itpp::UINT64_POW2, itpp::US, and wordlen. Referenced by Fix_Base(). |
|
Handle overflows using overflow mode
Definition at line 91 of file fix_base.cpp. References it_error, max, min, n_unused_bits, omode, itpp::Stat::sample(), itpp::SAT, 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=(), scale_and_apply_modes(), itpp::CFix::set_im(), itpp::Fix::set_re(), and itpp::CFix::set_re(). |
|
Convert from
Definition at line 1055 of file fix_base.h. References qmode. Referenced by itpp::Fix::set(), and itpp::CFix::set(). |
|
Convert from
Definition at line 131 of file fix_base.cpp. References 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(), shift, itpp::TRN, and itpp::TRN_ZERO. |
|
Right shift
Definition at line 1059 of file fix_base.h. References qmode. 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 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(), stat_ptr, itpp::TRN, and itpp::TRN_ZERO. |
|
Accumulated bitshift (positive means left-shifted, negative means right-shifted).
Definition at line 1032 of file fix_base.h. Referenced by itpp::assert_shifts(), 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::Fix::operator>>=(), itpp::CFix::operator>>=(), print(), itpp::Fix::rshift(), itpp::CFix::rshift(), scale_and_apply_modes(), itpp::Fix::set(), itpp::CFix::set(), set_shift(), itpp::Fix::unfix(), and itpp::CFix::unfix(). |
|
Word length.
Definition at line 1034 of file fix_base.h. Referenced by get_wordlen(), init(), and print(). |
|
Sign encoding mode.
Definition at line 1036 of file fix_base.h. Referenced by get_e_mode(), init(), and print(). |
|
Overflow mode.
Definition at line 1038 of file fix_base.h. Referenced by apply_o_mode(), get_o_mode(), and print(). |
|
Quantization mode.
Definition at line 1040 of file fix_base.h. Referenced by get_q_mode(), print(), rshift_and_apply_q_mode(), and scale_and_apply_modes(). |
|
Pointer to statistics object.
Definition at line 1042 of file fix_base.h. Referenced by apply_o_mode(), print(), and 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 apply_o_mode(), get_min(), init(), and print(). |
|
Maximum allowed value (help variable to speed up calculations).
Definition at line 1046 of file fix_base.h. Referenced by apply_o_mode(), get_max(), init(), and print(). |
|
Number of unused (MSB) bits (help variable to speed up calculations).
Definition at line 1048 of file fix_base.h. Referenced by apply_o_mode(), init(), and print(). |
Generated on Thu Apr 19 14:24:04 2007 for IT++ by Doxygen 1.4.6