IT++ Logo
Namespaces | Functions
fix_functions.h File Reference

Definitions of a set of functions for Fix, Fixed, CFix and CFixed classes. More...

#include <itpp/fixed/cfix.h>
#include <itpp/base/vec.h>
#include <itpp/base/mat.h>
#include <itpp/base/array.h>
#include <itpp/base/converters.h>
#include <itpp/itexports.h>

Go to the source code of this file.

Namespaces

namespace  itpp
 itpp namespace
 

Functions

template<class T >
bool itpp::is_fix (const T &)
 Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or CFix)
 
template<>
bool itpp::is_fix (const Fix &)
 Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or CFix)
 
template<>
bool itpp::is_fix (const fixvec &)
 Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or CFix)
 
template<>
bool itpp::is_fix (const fixmat &)
 Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or CFix)
 
template<>
bool itpp::is_fix (const CFix &)
 Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or CFix)
 
template<class T >
bool itpp::is_fix (const Array< T > &)
 Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or CFix)
 
void itpp::set_fix (Fix &y, double x, int n)
 Set y = x * pow2(n) using the quantization mode of y.
 
void itpp::set_fix (Fix &y, double x, int n, q_mode q)
 Set y = x * pow2(n) using the specified quantization mode q.
 
void itpp::set_fix (fixvec &y, const vec &x, int n)
 Set y = x * pow2(n) using the quantization mode of y.
 
void itpp::set_fix (fixvec &y, const vec &x, int n, q_mode q)
 Set y = x * pow2(n) using the specified quantization mode q.
 
void itpp::set_fix (fixmat &y, const mat &x, int n)
 Set y = x * pow2(n) using the quantization mode of y.
 
void itpp::set_fix (fixmat &y, const mat &x, int n, q_mode q)
 Set y = x * pow2(n) using the specified quantization mode q.
 
void itpp::set_fix (double &y, double x, int)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (double &y, double x, int, q_mode)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (vec &y, const vec &x, int)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (vec &y, const vec &x, int, q_mode)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (mat &y, const mat &x, int)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (mat &y, const mat &x, int, q_mode)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (CFix &y, std::complex< double > x, int n)
 Set y = x * pow2(n) using the quantization mode of y.
 
void itpp::set_fix (CFix &y, double real, double imag, int n)
 Set y = (real + i*imag) * pow2(n) using the quantization mode of y.
 
void itpp::set_fix (CFix &y, std::complex< double > x, int n, q_mode q)
 Set y = x * pow2(n) using the specified quantization mode q.
 
void itpp::set_fix (CFix &y, double real, double imag, int n, q_mode q)
 Set y = (real + i*imag) * pow2(n) using the specified quantization mode q.
 
void itpp::set_fix (cfixvec &y, const cvec &x, int n)
 Set y = x * pow2(n) using the quantization mode of y.
 
void itpp::set_fix (cfixvec &y, const vec &real, const vec &imag, int n)
 Set y = (real + i*imag) * pow2(n) using the quantization mode of y.
 
void itpp::set_fix (cfixvec &y, const cvec &x, int n, q_mode q)
 Set y = x * pow2(n) using the specified quantization mode q.
 
void itpp::set_fix (cfixvec &y, const vec &real, const vec &imag, int n, q_mode q)
 Set y = (real + i*imag) * pow2(n) using the specified quantization mode q.
 
void itpp::set_fix (cfixmat &y, const cmat &x, int n)
 Set y = x * pow2(n) using the quantization mode of y.
 
void itpp::set_fix (cfixmat &y, const mat &real, const mat &imag, int n)
 Set y = (real + i*imag) * pow2(n) using the quantization mode of y.
 
void itpp::set_fix (cfixmat &y, const cmat &x, int n, q_mode q)
 Set y = x * pow2(n) using the specified quantization mode q.
 
void itpp::set_fix (cfixmat &y, const mat &real, const mat &imag, int n, q_mode q)
 Set y = (real + i*imag) * pow2(n) using the specified quantization mode q.
 
void itpp::set_fix (std::complex< double > &y, const std::complex< double > &x, int)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (std::complex< double > &y, double real, double imag, int)
 Set y = real + i*imag. Useful in templated code.
 
void itpp::set_fix (std::complex< double > &y, const std::complex< double > &x, int, q_mode)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (std::complex< double > &y, double real, double imag, int, q_mode)
 Set y = real + i*imag. Useful in templated code.
 
void itpp::set_fix (cvec &y, const cvec &x, int)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (cvec &y, const vec &real, const vec &imag, int)
 Set y = real + i*imag. Useful in templated code.
 
void itpp::set_fix (cvec &y, const cvec &x, int, q_mode)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (cvec &y, const vec &real, const vec &imag, int, q_mode)
 Set y = real + i*imag. Useful in templated code.
 
void itpp::set_fix (cmat &y, const cmat &x, int)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (cmat &y, const mat &real, const mat &imag, int)
 Set y = real + i*imag. Useful in templated code.
 
void itpp::set_fix (cmat &y, const cmat &x, int, q_mode)
 Set y = x. Useful in templated code.
 
void itpp::set_fix (cmat &y, const mat &real, const mat &imag, int, q_mode)
 Set y = real + i*imag. Useful in templated code.
 
template<class T1 , class T2 >
void itpp::set_fix (Array< T1 > &y, const Array< T2 > &x, int n)
 Call set_fix for each Array element.
 
template<class T1 , class T2 >
void itpp::set_fix (Array< T1 > &y, const Array< T2 > &real, const Array< T2 > &imag, int n)
 Call set_fix for each Array element.
 
template<class T1 , class T2 >
void itpp::set_fix (Array< T1 > &y, const Array< T2 > &x, int n, q_mode q)
 Call set_fix for each Array element.
 
template<class T1 , class T2 >
void itpp::set_fix (Array< T1 > &y, const Array< T2 > &real, const Array< T2 > &imag, int n, q_mode q)
 Call set_fix for each Array element.
 
void itpp::lshift_fix (Fix &y, int n)
 Left shift n bits.
 
void itpp::rshift_fix (Fix &y, int n)
 Right shift n bits using the quantization mode of y.
 
void itpp::rshift_fix (Fix &y, int n, q_mode q)
 Right shift n bits using the specified quantization mode q.
 
void itpp::lshift_fix (fixvec &y, int n)
 Left shift n bits.
 
void itpp::rshift_fix (fixvec &y, int n)
 Right shift n bits using the quantization mode of y.
 
void itpp::rshift_fix (fixvec &y, int n, q_mode q)
 Right shift n bits using the specified quantization mode q.
 
void itpp::lshift_fix (fixmat &y, int n)
 Left shift n bits.
 
void itpp::rshift_fix (fixmat &y, int n)
 Right shift n bits using the quantization mode of y.
 
void itpp::rshift_fix (fixmat &y, int n, q_mode q)
 Right shift n bits using the specified quantization mode q.
 
void itpp::lshift_fix (double &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (double &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (double &, int, q_mode)
 Dummy function useful in templated code.
 
void itpp::lshift_fix (vec &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (vec &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (vec &, int, q_mode)
 Dummy function useful in templated code.
 
void itpp::lshift_fix (mat &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (mat &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (mat &, int, q_mode)
 Dummy function useful in templated code.
 
void itpp::lshift_fix (CFix &y, int n)
 Left shift n bits.
 
void itpp::rshift_fix (CFix &y, int n)
 Right shift n bits using the quantization mode of y.
 
void itpp::rshift_fix (CFix &y, int n, q_mode q)
 Right shift n bits using the specified quantization mode q.
 
void itpp::lshift_fix (std::complex< double > &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (std::complex< double > &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (std::complex< double > &, int, q_mode)
 Dummy function useful in templated code.
 
void itpp::lshift_fix (cvec &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (cvec &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (cvec &, int, q_mode)
 Dummy function useful in templated code.
 
void itpp::lshift_fix (cmat &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (cmat &, int)
 Dummy function useful in templated code.
 
void itpp::rshift_fix (cmat &, int, q_mode)
 Dummy function useful in templated code.
 
template<class T >
void itpp::lshift_fix (Array< T > &y, int n)
 Call lshift_fix for each Array element.
 
template<class T >
void itpp::rshift_fix (Array< T > &y, int n)
 Call rshift_fix for each Array element.
 
template<class T >
void itpp::rshift_fix (Array< T > &y, int n, q_mode q)
 Call rshift_fix for each Array element.
 
void itpp::assert_fixshift (double, int)
 If x is a fixed-point variable, assert that x has the specified shift value, otherwise do nothing.
 
void itpp::assert_fixshift (const std::complex< double > &, int)
 If x is a fixed-point variable, assert that x has the specified shift value, otherwise do nothing.
 
void itpp::assert_fixshift (const Fix &x, int shift)
 If x is a fixed-point variable, assert that x has the specified shift value, otherwise do nothing.
 
void itpp::assert_fixshift (const CFix &x, int shift)
 If x is a fixed-point variable, assert that x has the specified shift value, otherwise do nothing.
 
vec itpp::to_vec (const fixvec &v)
 Converts a fixvec to vec.
 
cvec itpp::to_cvec (const cfixvec &v)
 Converts a cfixvec to cvec.
 
mat itpp::to_mat (const fixmat &m)
 Converts a fixmat to mat.
 
cmat itpp::to_cmat (const cfixmat &m)
 Converts a cfixmat to cmat.
 
template<class T >
itpp::to (double x)
 Convert double to T.
 
template<class T >
itpp::to (const Fix &x)
 Convert Fix to T.
 
template<class T >
itpp::to (const std::complex< double > &x)
 Convert std::complex<double> to T.
 
template<class T >
itpp::to (const CFix &x)
 Convert CFix to T.
 
template<class T >
itpp::to (double real, double imag)
 Convert double (real and imaginary parts) to T.
 
template<class T >
itpp::to (const Fix &real, const Fix &imag)
 Convert Fix (real and imaginary parts) to T.
 
template<class T , class U >
Vec< T > itpp::to (const Vec< U > &x)
 Convert Vec<U> to Vec<T>
 
template<>
vec itpp::to< double > (const vec &x)
 Convert vec to vec.
 
template<>
cvec itpp::to< std::complex< double > > (const cvec &x)
 Convert cvec to cvec.
 
template<>
fixvec itpp::to< Fix > (const fixvec &x)
 Convert fixvec to fixvec.
 
template<>
cfixvec itpp::to< CFix > (const cfixvec &x)
 Convert cfixvec to cfixvec.
 
template<class T , class U >
Vec< T > itpp::to (const Vec< U > &real, const Vec< U > &imag)
 Convert Vec<U> (real and imaginary parts) to Vec<T>
 
template<class T , class U >
Mat< T > itpp::to (const Mat< U > &x)
 Convert Mat<U> to Mat<T>
 
template<>
mat itpp::to< double > (const mat &x)
 Convert mat to mat.
 
template<>
cmat itpp::to< std::complex< double > > (const cmat &x)
 Convert cmat to cmat.
 
template<>
fixmat itpp::to< Fix > (const fixmat &x)
 Convert fixmat to fixmat.
 
template<>
cfixmat itpp::to< CFix > (const cfixmat &x)
 Convert cfixmat to cfixmat.
 
template<class T , class U >
Mat< T > itpp::to (const Mat< U > &real, const Mat< U > &imag)
 Convert Mat<U> (real and imaginary parts) to Mat<T>
 
template<class T , class U >
Array< typename ConvertU2T< T,
U >::result > 
itpp::to (const Array< U > &x)
 Convert Array<U>, where U can be an Array/Vec/Mat, to a corresponding Array with T elements.
 
template<class T , class U >
Array< typename ConvertU2T< T,
U >::result > 
itpp::to (const Array< U > &real, const Array< U > &imag)
 Convert Array<U> (real and imaginary parts), where U can be an Array/Vec/Mat, to a corresponding Array with T elements.
 
double itpp::unfix (const Fix &x)
 Convert Fix to double by multiplying the bit representation with pow2(-shift)
 
std::complex< double > itpp::unfix (const CFix &x)
 Convert CFix to std::complex<double> by multiplying the bit representation with pow2(-shift)
 
vec itpp::unfix (const fixvec &x)
 Convert fixvec to vec by multiplying the bit representations with pow2(-shift)
 
mat itpp::unfix (const fixmat &x)
 Convert fixmat to mat by multiplying the bit representations with pow2(-shift)
 
double itpp::unfix (double x)
 Convert double to double i.e. do nothing.
 
std::complex< double > itpp::unfix (const std::complex< double > &x)
 Convert std::complex<double> to std::complex<double> i.e. do nothing.
 
vec itpp::unfix (const vec &x)
 Convert vec to vec i.e. do nothing.
 
cvec itpp::unfix (const cvec &x)
 Convert cvec to cvec i.e. do nothing.
 
mat itpp::unfix (const mat &x)
 Convert mat to mat i.e. do nothing.
 
cmat itpp::unfix (const cmat &x)
 Convert cmat to cmat i.e. do nothing.
 
template<class T >
Array< typename Convert< T >
::to_double > 
itpp::unfix (const Array< T > &x)
 Convert floating- or fixed-point Array to floating-point Array.
 
Fix itpp::abs (const Fix &x)
 Absolute value.
 
Fix itpp::real (const CFix &x)
 Real part of complex value.
 
Fix itpp::imag (const CFix &x)
 Imaginary part of complex value.
 
CFix itpp::conj (const CFix &x)
 Conjugate of complex value.
 

Detailed Description

Definitions of a set of functions for Fix, Fixed, CFix and CFixed classes.

Author
Johan Bergman

Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors)

This file is part of IT++ - a C++ library of mathematical, signal processing, speech processing, and communications classes and functions.

IT++ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

IT++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with IT++. If not, see http://www.gnu.org/licenses/.


Definition in file fix_functions.h.

SourceForge Logo

Generated on Sat Jul 6 2013 10:54:27 for IT++ by Doxygen 1.8.2