itpp::Fix_Base Class Reference
Fixed-point Module

Base class for fixed-point data types. More...

`#include <itpp/fixed/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)

## Detailed Description

Base class for fixed-point data types.

See the Detailed Description in the Fixed-point Module module.

Definition at line 981 of file fix_base.h.

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

- itpp/fixed/fix_base.h
- itpp/fixed/fix_base.cpp

Generated on Thu Aug 20 2015 21:02:53 for IT++ by Doxygen 1.8.9.1