Fixed-point data type.
More...
#include <itpp/fixed/fix.h>
|
|
| Fix (double x=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.
|
| |
|
| Fix (const Fix_Factory &f) |
| | Constructor.
|
| |
|
| Fix (fixrep r, int s, int, int) |
| | Constructor for internal use. No restrictions are applied. The dummies help to avoid ambiguities.
|
| |
|
| Fix (const Fix &x, int w=MAX_WORDLEN, e_mode e=TC, o_mode o=WRAP, q_mode q=TRN, Stat *ptr=0) |
| | Copy constructor.
|
| |
|
virtual | ~Fix () |
| | Destructor.
|
| |
|
Fix & | operator= (const Fix &x) |
| | Assignment from Fix.
|
| |
|
Fix & | operator= (const 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 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.
|
| |
|
|
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)
|
| |
|
|
class | CFix |
| |
|
template<int , e_mode , o_mode , q_mode > |
| class | Fixed |
| |
|
template<int , e_mode , o_mode , q_mode > |
| class | CFixed |
| |
|
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)
|
| |
|
ITPP_EXPORT 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)
|
| |
|
ITPP_EXPORT int | assert_shifts (const Fix &x, int y) |
| | Check that x.shift==0 OR x==0 OR y==0 and return x.shift.
|
| |
Fixed-point data type.
See the Detailed Description in the Fixed-point Module module.
Definition at line 51 of file fix.h.
The documentation for this class was generated from the following files: