fix_operators.h
Go to the documentation of this file.
#ifndef FIX_OPERATORS_H
#define FIX_OPERATORS_H
#include <itpp/fixed/cfix.h>
#include <itpp/fixed/fix_functions.h>
#include <itpp/itexports.h>
namespace itpp
{
// Operators for Fix and Fixed //
ITPP_EXPORT Fix operator+(const Fix &x, const Fix &y);
ITPP_EXPORT Fix operator-(const Fix &x, const Fix &y);
ITPP_EXPORT Fix operator*(const Fix &x, const Fix &y);
ITPP_EXPORT Fix operator/(const Fix &x, const Fix &y);
ITPP_EXPORT Fix operator+(const Fix &x, const int y);
ITPP_EXPORT Fix operator-(const Fix &x, const int y);
ITPP_EXPORT Fix operator*(const Fix &x, const int y);
ITPP_EXPORT Fix operator/(const Fix &x, const int y);
ITPP_EXPORT Fix operator+(const int x, const Fix &y);
ITPP_EXPORT Fix operator-(const int x, const Fix &y);
ITPP_EXPORT Fix operator*(const int x, const Fix &y);
ITPP_EXPORT Fix operator/(const int x, const Fix &y);
inline fixvec operator+(const fixvec &v, const int s) {return v + Fix(s);}
inline fixvec operator+(const int s, const fixvec &v) {return Fix(s) + v;}
inline fixvec operator-(const fixvec &v, const int s) {return v - Fix(s);}
inline fixvec operator-(const int s, const fixvec &v) {return Fix(s) - v;}
inline fixvec operator*(const fixvec &v, const int s) {return v * Fix(s);}
inline fixvec operator*(const int s, const fixvec &v) {return Fix(s) * v;}
inline fixvec operator/(const fixvec &v, const int s) {return v / Fix(s);}
inline fixmat operator+(const fixmat &v, const int s) {return v + Fix(s);}
inline fixmat operator+(const int s, const fixmat &v) {return Fix(s) + v;}
inline fixmat operator-(const fixmat &v, const int s) {return v - Fix(s);}
inline fixmat operator-(const int s, const fixmat &v) {return Fix(s) - v;}
inline fixmat operator*(const fixmat &v, const int s) {return v * Fix(s);}
inline fixmat operator*(const int s, const fixmat &v) {return Fix(s) * v;}
inline fixmat operator/(const fixmat &v, const int s) {return v / Fix(s);}
ITPP_EXPORT fixvec operator+(const fixvec &a, const ivec &b);
inline fixvec operator+(const ivec &a, const fixvec &b) {return b + a;}
inline fixvec operator-(const fixvec &a, const ivec &b) {return a + (-b);}
inline fixvec operator-(const ivec &a, const fixvec &b) {return (-b) + a;}
ITPP_EXPORT Fix operator*(const fixvec &a, const ivec &b);
inline Fix operator*(const ivec &a, const fixvec &b) {return b*a;}
ITPP_EXPORT fixmat operator+(const fixmat &a, const imat &b);
inline fixmat operator+(const imat &a, const fixmat &b) {return b + a;}
inline fixmat operator-(const fixmat &a, const imat &b) {return a + (-b);}
inline fixmat operator-(const imat &a, const fixmat &b) {return (-b) + a;}
ITPP_EXPORT fixmat operator*(const fixmat &a, const imat &b);
inline fixmat operator*(const imat &a, const fixmat &b) {return b*a;}
// Operators for CFix and CFixed //
ITPP_EXPORT CFix operator+(const CFix &x, const CFix &y);
ITPP_EXPORT CFix operator-(const CFix &x, const CFix &y);
ITPP_EXPORT CFix operator*(const CFix &x, const CFix &y);
ITPP_EXPORT CFix operator/(const CFix &x, const CFix &y);
ITPP_EXPORT CFix operator+(const CFix &x, const Fix &y);
ITPP_EXPORT CFix operator-(const CFix &x, const Fix &y);
ITPP_EXPORT CFix operator*(const CFix &x, const Fix &y);
ITPP_EXPORT CFix operator/(const CFix &x, const Fix &y);
ITPP_EXPORT CFix operator+(const Fix &x, const CFix &y);
ITPP_EXPORT CFix operator-(const Fix &x, const CFix &y);
ITPP_EXPORT CFix operator*(const Fix &x, const CFix &y);
ITPP_EXPORT CFix operator/(const Fix &x, const CFix &y);
ITPP_EXPORT CFix operator+(const CFix &x, const int y);
ITPP_EXPORT CFix operator-(const CFix &x, const int y);
ITPP_EXPORT CFix operator*(const CFix &x, const int y);
ITPP_EXPORT CFix operator/(const CFix &x, const int y);
ITPP_EXPORT CFix operator+(const int x, const CFix &y);
ITPP_EXPORT CFix operator-(const int x, const CFix &y);
ITPP_EXPORT CFix operator*(const int x, const CFix &y);
ITPP_EXPORT CFix operator/(const int x, const CFix &y);
inline cfixvec operator+(const fixvec &v, const CFix &s) {return to<CFix>(v) + s;}
inline cfixvec operator+(const CFix &s, const fixvec &v) {return s + to<CFix>(v);}
inline cfixvec operator-(const fixvec &v, const CFix &s) {return to<CFix>(v) - s;}
inline cfixvec operator-(const CFix &s, const fixvec &v) {return s - to<CFix>(v);}
inline cfixvec operator*(const fixvec &v, const CFix &s) {return to<CFix>(v) * s;}
inline cfixvec operator*(const CFix &s, const fixvec &v) {return s * to<CFix>(v);}
inline cfixvec operator/(const fixvec &v, const CFix &s) {return to<CFix>(v) / s;}
inline cfixmat operator+(const fixmat &m, const CFix &s) {return to<CFix>(m) + s;}
inline cfixmat operator+(const CFix &s, const fixmat &m) {return s + to<CFix>(m);}
inline cfixmat operator-(const fixmat &m, const CFix &s) {return to<CFix>(m) - s;}
inline cfixmat operator-(const CFix &s, const fixmat &m) {return s - to<CFix>(m);}
inline cfixmat operator*(const fixmat &m, const CFix &s) {return to<CFix>(m) * s;}
inline cfixmat operator*(const CFix &s, const fixmat &m) {return s * to<CFix>(m);}
inline cfixmat operator/(const fixmat &m, const CFix &s) {return to<CFix>(m) / s;}
inline cfixvec operator+(const ivec &v, const CFix &s) {return to<CFix>(to_vec(v)) + s;}
inline cfixvec operator+(const CFix &s, const ivec &v) {return s + to<CFix>(to_vec(v));}
inline cfixvec operator-(const ivec &v, const CFix &s) {return to<CFix>(to_vec(v)) - s;}
inline cfixvec operator-(const CFix &s, const ivec &v) {return s - to<CFix>(to_vec(v));}
inline cfixvec operator*(const ivec &v, const CFix &s) {return to<CFix>(to_vec(v)) * s;}
inline cfixvec operator*(const CFix &s, const ivec &v) {return s * to<CFix>(to_vec(v));}
inline cfixvec operator/(const ivec &v, const CFix &s) {return to<CFix>(to_vec(v)) / s;}
inline cfixmat operator+(const imat &m, const CFix &s) {return to<CFix>(to_mat(m)) + s;}
inline cfixmat operator+(const CFix &s, const imat &m) {return s + to<CFix>(to_mat(m));}
inline cfixmat operator-(const imat &m, const CFix &s) {return to<CFix>(to_mat(m)) - s;}
inline cfixmat operator-(const CFix &s, const imat &m) {return s - to<CFix>(to_mat(m));}
inline cfixmat operator*(const imat &m, const CFix &s) {return to<CFix>(to_mat(m)) * s;}
inline cfixmat operator*(const CFix &s, const imat &m) {return s * to<CFix>(to_mat(m));}
inline cfixmat operator/(const imat &m, const CFix &s) {return to<CFix>(to_mat(m)) / s;}
inline cfixvec operator+(const cfixvec &v, const Fix &s) {return v + CFix(s);}
inline cfixvec operator+(const Fix &s, const cfixvec &v) {return CFix(s) + v;}
inline cfixvec operator-(const cfixvec &v, const Fix &s) {return v - CFix(s);}
inline cfixvec operator-(const Fix &s, const cfixvec &v) {return CFix(s) - v;}
inline cfixvec operator*(const cfixvec &v, const Fix &s) {return v * CFix(s);}
inline cfixvec operator*(const Fix &s, const cfixvec &v) {return CFix(s) * v;}
inline cfixvec operator/(const cfixvec &v, const Fix &s) {return v / CFix(s);}
inline cfixmat operator+(const cfixmat &m, const Fix &s) {return m + CFix(s);}
inline cfixmat operator+(const Fix &s, const cfixmat &m) {return CFix(s) + m;}
inline cfixmat operator-(const cfixmat &m, const Fix &s) {return m - CFix(s);}
inline cfixmat operator-(const Fix &s, const cfixmat &m) {return CFix(s) - m;}
inline cfixmat operator*(const cfixmat &m, const Fix &s) {return m * CFix(s);}
inline cfixmat operator*(const Fix &s, const cfixmat &m) {return CFix(s) * m;}
inline cfixmat operator/(const cfixmat &m, const Fix &s) {return m / CFix(s);}
inline cfixvec operator+(const cfixvec &v, const int s) {return v + CFix(s);}
inline cfixvec operator+(const int s, const cfixvec &v) {return CFix(s) + v;}
inline cfixvec operator-(const cfixvec &v, const int s) {return v - CFix(s);}
inline cfixvec operator-(const int s, const cfixvec &v) {return CFix(s) - v;}
inline cfixvec operator*(const cfixvec &v, const int s) {return v * CFix(s);}
inline cfixvec operator*(const int s, const cfixvec &v) {return CFix(s) * v;}
inline cfixvec operator/(const cfixvec &v, const int s) {return v / CFix(s);}
inline cfixmat operator+(const cfixmat &m, const int s) {return m + CFix(s);}
inline cfixmat operator+(const int s, const cfixmat &m) {return CFix(s) + m;}
inline cfixmat operator-(const cfixmat &m, const int s) {return m - CFix(s);}
inline cfixmat operator-(const int s, const cfixmat &m) {return CFix(s) - m;}
inline cfixmat operator*(const cfixmat &m, const int s) {return m * CFix(s);}
inline cfixmat operator*(const int s, const cfixmat &m) {return CFix(s) * m;}
inline cfixmat operator/(const cfixmat &m, const int s) {return m / CFix(s);}
ITPP_EXPORT cfixvec operator+(const cfixvec &a, const fixvec &b);
inline cfixvec operator+(const fixvec &a, const cfixvec &b) {return b + a;}
inline cfixvec operator-(const cfixvec &a, const fixvec &b) {return a + (-b);}
inline cfixvec operator-(const fixvec &a, const cfixvec &b) {return (-b) + a;}
ITPP_EXPORT CFix operator*(const cfixvec &a, const fixvec &b);
inline CFix operator*(const fixvec &a, const cfixvec &b) {return b*a;}
ITPP_EXPORT cfixmat operator+(const cfixmat &a, const fixmat &b);
inline cfixmat operator+(const fixmat &a, const cfixmat &b) {return b + a;}
inline cfixmat operator-(const cfixmat &a, const fixmat &b) {return a + (-b);}
inline cfixmat operator-(const fixmat &a, const cfixmat &b) {return (-b) + a;}
ITPP_EXPORT cfixmat operator*(const cfixmat &a, const fixmat &b);
inline cfixmat operator*(const fixmat &a, const cfixmat &b) {return b*a;}
ITPP_EXPORT cfixvec operator+(const cfixvec &a, const ivec &b);
inline cfixvec operator+(const ivec &a, const cfixvec &b) {return b + a;}
inline cfixvec operator-(const cfixvec &a, const ivec &b) {return a + (-b);}
inline cfixvec operator-(const ivec &a, const cfixvec &b) {return (-b) + a;}
ITPP_EXPORT CFix operator*(const cfixvec &a, const ivec &b);
inline CFix operator*(const ivec &a, const cfixvec &b) {return b*a;}
ITPP_EXPORT cfixmat operator+(const cfixmat &a, const imat &b);
inline cfixmat operator+(const imat &a, const cfixmat &b) {return b + a;}
inline cfixmat operator-(const cfixmat &a, const imat &b) {return a + (-b);}
inline cfixmat operator-(const imat &a, const cfixmat &b) {return (-b) + a;}
ITPP_EXPORT cfixmat operator*(const cfixmat &a, const imat &b);
inline cfixmat operator*(const imat &a, const cfixmat &b) {return b*a;}
} // namespace itpp
#endif // #ifndef FIX_OPERATORS_H
itpp::to< CFix >
cfixvec to< CFix >(const cfixvec &x)
Convert cfixvec to cfixvec.
Definition: fix_functions.h:393
itpp::operator/
Mat< Num_T > operator/(const Mat< Num_T > &m, Num_T t)
Element-wise division by a scalar.
Definition: mat.h:1670
fix_functions.h
Definitions of a set of functions for Fix, Fixed, CFix and CFixed classes.
itpp::cfixmat
Mat< CFix > cfixmat
Typedef for complex fixed-point matrix type.
Definition: cfix.h:180
itpp::Mat
Matrix Class (Templated)
Definition: factory.h:41
itpp::to_mat
mat to_mat(const Mat< T > &m)
Converts a Mat<T> to mat.
Definition: converters.h:216
itpp::CFix
Complex fixed-point data type.
Definition: cfix.h:51
itpp::operator-
Mat< Num_T > operator-(const Mat< Num_T > &m1, const Mat< Num_T > &m2)
Subtraction of two matrices.
Definition: mat.h:1382
itpp::operator+
GF2mat operator+(const GF2mat &X, const GF2mat &Y)
GF(2) matrix addition.
Definition: gf2mat.cpp:948
itpp::to_vec
vec to_vec(const Vec< T > &v)
Converts a Vec<T> to vec.
Definition: converters.h:93
itpp::operator*
GF2mat operator*(const GF2mat &X, const GF2mat &Y)
GF(2) matrix multiplication.
Definition: gf2mat.cpp:847
itpp::Fix
Fixed-point data type.
Definition: fix.h:51
itpp::cfixvec
Vec< CFix > cfixvec
Typedef for complex fixed-point vector type.
Definition: cfix.h:178
itpp::Vec
Vector Class (Templated)
Definition: factory.h:42
itpp::fixmat
Mat< Fix > fixmat
Typedef for fixed-point matrix type.
Definition: fix.h:153
itpp::fixvec
Vec< Fix > fixvec
Typedef for fixed-point vector type.
Definition: fix.h:151
cfix.h
Definitions of a complex fixed-point data type CFix.

Generated on Thu Mar 20 2014 12:26:43 for IT++ by Doxygen 1.8.6