36#include <itpp/itexports.h>
43inline std::complex<double>
operator+(
const int &x,
const std::complex<double> &y) {
return std::complex<double>(x + y.real(), y.imag());}
45inline std::complex<double>
operator+(
const float &x,
const std::complex<double> &y) {
return std::complex<double>(x + y.real(), y.imag());}
47inline std::complex<double>
operator+(
const std::complex<double> &x,
const int &y) {
return std::complex<double>(x.real() + y, x.imag());}
49inline std::complex<double>
operator+(
const std::complex<double> &x,
const float &y) {
return std::complex<double>(x.real() + y, x.imag());}
52inline std::complex<double>
operator-(
const int &x,
const std::complex<double> &y) {
return std::complex<double>(x - y.real(), -y.imag());}
54inline std::complex<double>
operator-(
const float &x,
const std::complex<double> &y) {
return std::complex<double>(x - y.real(), -y.imag());}
56inline std::complex<double>
operator-(
const std::complex<double> &x,
const int &y) {
return std::complex<double>(x.real() - y, x.imag());}
58inline std::complex<double>
operator-(
const std::complex<double> &x,
const float &y) {
return std::complex<double>(x.real() - y, x.imag());}
61inline std::complex<double>
operator*(
const int &x,
const std::complex<double> &y) {
return std::complex<double>(x*y.real(), x*y.imag());}
63inline std::complex<double>
operator*(
const float &x,
const std::complex<double> &y) {
return std::complex<double>(x*y.real(), x*y.imag());}
65inline std::complex<double>
operator*(
const std::complex<double> &x,
const int &y) {
return std::complex<double>(x.real()*y, x.imag()*y);}
67inline std::complex<double>
operator*(
const std::complex<double> &x,
const float &y) {
return std::complex<double>(x.real()*y, x.imag()*y);}
70inline std::complex<double>
operator/(
const std::complex<double> &x,
const int &y) {
return std::complex<double>(x.real() / y, x.imag() / y);}
72inline std::complex<double>
operator/(
const std::complex<double> &x,
const float &y) {
return std::complex<double>(x.real() / y, x.imag() / y);}
81inline vec operator+(
const float &s,
const vec &v) {
return static_cast<double>(s) + v;}
87inline vec operator+(
const short &s,
const vec &v) {
return static_cast<double>(s) + v;}
93inline vec operator+(
const int &s,
const vec &v) {
return static_cast<double>(s) + v;}
99inline vec operator+(
const vec &v,
const float &s) {
return static_cast<double>(s) + v;}
105inline vec operator+(
const vec &v,
const short &s) {
return static_cast<double>(s) + v;}
117inline vec operator-(
const float &s,
const vec &v) {
return static_cast<double>(s) - v;}
123inline vec operator-(
const short &s,
const vec &v) {
return static_cast<double>(s) - v;}
171cvec
operator*(
const std::complex<double> &s,
const vec &v);
195cvec
operator*(
const vec &v,
const std::complex<double> &s);
201inline vec operator/(
const vec &v,
const float &s) {
return v /
static_cast<double>(s);}
207inline vec operator/(
const vec &v,
const short &s) {
return v /
static_cast<double>(s);}
222ITPP_EXPORT vec
operator+(
const double &s,
const ivec &v);
234ITPP_EXPORT vec
operator-(
const double &s,
const ivec &v);
246ITPP_EXPORT vec
operator*(
const double &s,
const ivec &v);
258ITPP_EXPORT vec
operator/(
const double &s,
const ivec &v);
264ITPP_EXPORT vec
operator/(
const ivec &v,
const double &s);
270ITPP_EXPORT cvec
operator+(
const std::complex<double> &s,
const ivec &v);
282ITPP_EXPORT cvec
operator-(
const std::complex<double> &s,
const ivec &v);
294ITPP_EXPORT cvec
operator*(
const std::complex<double> &s,
const ivec &v);
306ITPP_EXPORT cvec
operator/(
const std::complex<double> &s,
const ivec &v);
312ITPP_EXPORT cvec
operator/(
const ivec &v,
const std::complex<double> &s);
320ITPP_EXPORT cvec
operator+(
const double &s,
const cvec &v);
368ITPP_EXPORT cvec
operator-(
const double &s,
const cvec &v);
416ITPP_EXPORT cvec
operator*(
const double &s,
const cvec &v);
464ITPP_EXPORT cvec
operator/(
const cvec &v,
const double &s);
470ITPP_EXPORT cvec
operator/(
const double &s,
const cvec &v);
496inline mat operator+(
const float &s,
const mat &m) {
return static_cast<double>(s) + m;}
502inline mat operator+(
const short &s,
const mat &m) {
return static_cast<double>(s) + m;}
514inline mat operator+(
const mat &m,
const float &s) {
return static_cast<double>(s) + m;}
520inline mat operator+(
const mat &m,
const short &s) {
return static_cast<double>(s) + m;}
532inline mat operator-(
const float &s,
const mat &m) {
return static_cast<double>(s) - m;}
538inline mat operator-(
const short &s,
const mat &m) {
return static_cast<double>(s) - m;}
604inline mat operator/(
const mat &m,
const float &s) {
return m /
static_cast<double>(s);}
610inline mat operator/(
const mat &m,
const short &s) {
return m /
static_cast<double>(s);}
624ITPP_EXPORT cmat
operator+(
const double &s,
const cmat &m);
630ITPP_EXPORT cmat
operator-(
const double &s,
const cmat &m);
636ITPP_EXPORT cmat
operator*(
const double &s,
const cmat &m);
642ITPP_EXPORT cmat
operator*(
const std::complex<double> &s,
const mat &m);
654ITPP_EXPORT cmat
operator/(
const cmat &m,
const double &s);
662ITPP_EXPORT vec
operator+(
const bvec &a,
const vec &b);
668ITPP_EXPORT vec
operator+(
const svec &a,
const vec &b);
674ITPP_EXPORT vec
operator+(
const ivec &a,
const vec &b);
734ITPP_EXPORT
double operator*(
const bvec &a,
const vec &b);
740ITPP_EXPORT
double operator*(
const svec &a,
const vec &b);
746ITPP_EXPORT
double operator*(
const ivec &a,
const vec &b);
772ITPP_EXPORT cvec
operator+(
const bvec &a,
const cvec &b);
778ITPP_EXPORT cvec
operator+(
const svec &a,
const cvec &b);
784ITPP_EXPORT cvec
operator+(
const ivec &a,
const cvec &b);
844ITPP_EXPORT std::complex<double>
operator*(
const bvec &a,
const cvec &b);
850ITPP_EXPORT std::complex<double>
operator*(
const svec &a,
const cvec &b);
856ITPP_EXPORT std::complex<double>
operator*(
const ivec &a,
const cvec &b);
mat operator+(const mat &a, const smat &b)
Addition operator for mat and smat.
mat operator-(const mat &a, const bmat &b)
Subtraction operator for mat and bmat.
mat operator+(const mat &m, const int &s)
Addition operator for mat and int.
mat operator-(const mat &a, const smat &b)
Subtraction operator for mat and smat.
cmat operator*(const bmat &a, const cmat &b)
Multiplication operator for bmat and cmat.
cmat operator+(const cmat &a, const imat &b)
Addition operator for cmat and imat.
cmat operator*(const cmat &a, const mat &b)
Multiplication operator for cmat and mat.
cmat operator*(const mat &m, const std::complex< double > &s)
Multiplication operator for mat and complex<double>
cmat operator*(const cmat &a, const smat &b)
Multiplication operator for cmat and smat.
mat operator+(const short &s, const mat &m)
Addition operator for short and mat.
mat operator*(const mat &m, const float &s)
Multiplication operator for mat and float.
mat operator*(const int &s, const mat &m)
Multiplication operator for int and mat.
cmat operator+(const cmat &a, const bmat &b)
Addition operator for cmat and bmat.
mat operator-(const mat &m, const int &s)
Subtraction operator for mat and int.
cmat operator-(const cmat &a, const imat &b)
Subtraction operator for cmat and imat.
mat operator-(const imat &a, const mat &b)
Subtraction operator for imat and mat.
mat operator+(const float &s, const mat &m)
Addition operator for float and mat.
mat operator-(const mat &m, const float &s)
Subtraction operator for mat and float.
mat operator+(const mat &a, const bmat &b)
Addition operator for mat and bmat.
mat operator*(const float &s, const mat &m)
Multiplication operator for float and mat.
cmat operator-(const mat &a, const cmat &b)
Subtraction operator for mat and cmat.
mat operator+(const int &s, const mat &m)
Addition operator for int and mat.
cmat operator*(const mat &a, const cmat &b)
Multiplication operator for mat and cmat.
cmat operator*(const cmat &a, const bmat &b)
Multiplication operator for cmat and bmat.
cmat operator-(const cmat &a, const bmat &b)
Subtraction operator for cmat and bmat.
cmat operator*(const imat &a, const cmat &b)
Multiplication operator for imat and cmat.
cmat operator-(const smat &a, const cmat &b)
Subtraction operator for smat and cmat.
mat operator/(const mat &m, const short &s)
Division operator for mat and short.
cmat operator+(const cmat &a, const mat &b)
Addition operator for cmat and mat.
cmat operator*(const cmat &a, const imat &b)
Multiplication operator for cmat and imat.
mat operator-(const mat &m, const short &s)
Subtraction operator for mat and short.
mat operator-(const int &s, const mat &m)
Subtraction operator for int and mat.
cmat operator-(const bmat &a, const cmat &b)
Subtraction operator for bmat and cmat.
mat operator+(const mat &m, const short &s)
Addition operator for mat and short.
ITPP_EXPORT mat operator+(const bmat &a, const mat &b)
Addition operator for bmat and mat.
mat operator*(const mat &m, const int &s)
Multiplication operator for mat and int.
cmat operator-(const cmat &a, const smat &b)
Subtraction operator for cmat and smat.
cmat operator+(const cmat &a, const smat &b)
Addition operator for cmat and smat.
mat operator-(const float &s, const mat &m)
Subtraction operator for float and mat.
cmat operator-(const cmat &a, const mat &b)
Subtraction operator for cmat and mat.
mat operator-(const smat &a, const mat &b)
Subtraction operator for smat and mat.
mat operator+(const mat &a, const imat &b)
Addition operator for mat and imat.
mat operator*(const mat &m, const short &s)
Multiplication operator for mat and short.
cmat operator-(const imat &a, const cmat &b)
Subtraction operator for imat and cmat.
cmat operator*(const smat &a, const cmat &b)
Multiplication operator for smat and cmat.
mat operator/(const mat &m, const int &s)
Division operator for mat and int.
mat operator+(const mat &m, const float &s)
Addition operator for mat and float.
mat operator-(const short &s, const mat &m)
Subtraction operator for short and mat.
mat operator*(const short &s, const mat &m)
Multiplication operator for short and mat.
mat operator/(const mat &m, const float &s)
Division operator for mat and float.
mat operator-(const mat &a, const imat &b)
Subtraction operator for mat and imat.
ITPP_EXPORT cmat operator+(const bmat &a, const cmat &b)
Addition operator for bmat and cmat.
mat operator-(const bmat &a, const mat &b)
Subtraction operator for bmat and mat.
vec operator-(const vec &v, const float &s)
Subtraction operator for vec and float.
cvec operator+(const cvec &v, const int &s)
Addition operator for cvec and int.
vec operator-(const short &s, const vec &v)
Subtraction operator for short and vec.
vec operator+(const short &s, const vec &v)
Addition operator for short and vec.
vec operator-(const bvec &a, const vec &b)
Subtraction operator for bvec and vec.
vec operator*(const vec &v, const int &s)
Multiplication operator for vec and int.
cvec operator+(const float &s, const cvec &v)
Addition operator for float and cvec.
vec operator+(const vec &v, const float &s)
Addition operator for vec and float.
vec operator+(const ivec &v, const double &s)
Addition operator for ivec and double.
cvec operator-(const float &s, const cvec &v)
Subtraction operator for float and cvec.
vec operator-(const vec &v, const int &s)
Subtraction operator for vec and int.
vec operator+(const vec &v, const short &s)
Addition operator for vec and short.
cvec operator*(const cvec &v, const double &s)
Multiplication operator for cvec and double.
vec operator-(const svec &a, const vec &b)
Subtraction operator for svec and vec.
cvec operator+(const cvec &a, const ivec &b)
Addition operator for cvec and ivec.
cvec operator*(const cvec &v, const short &s)
Multiplication operator for cvec and short.
cvec operator/(const cvec &v, const int &s)
Division operator for cvec and int.
cvec operator*(const short &s, const cvec &v)
Multiplication operator for short and cvec.
cvec operator-(const cvec &v, const short &s)
Subtraction operator for cvec and short.
double operator*(const vec &a, const ivec &b)
Multiplication operator for vec and ivec.
cvec operator-(const ivec &v, const std::complex< double > &s)
Subtraction operator for ivec and complex<double>
cvec operator/(const cvec &v, const short &s)
Division operator for cvec and short.
vec operator*(const vec &v, const short &s)
Multiplication operator for vec and short.
cvec operator-(const svec &a, const cvec &b)
Subtraction operator for svec and cvec.
vec operator-(const vec &a, const svec &b)
Subtraction operator for vec and svec.
cvec operator/(const cvec &v, const float &s)
Division operator for cvec and float.
std::complex< double > operator*(const cvec &a, const bvec &b)
Multiplication operator for cvec and bvec.
vec operator*(const ivec &v, const double &s)
Multiplication operator for ivec and double.
std::complex< double > operator*(const cvec &a, const ivec &b)
Multiplication operator for cvec and ivec.
cvec operator*(const cvec &v, const float &s)
Multiplication operator for cvec and float.
vec operator-(const int &s, const vec &v)
Subtraction operator for int and vec.
vec operator*(const vec &v, const float &s)
Multiplication operator for vec and float.
std::complex< double > operator*(const cvec &a, const svec &b)
Multiplication operator for cvec and svec.
cvec operator-(const cvec &a, const svec &b)
Subtraction operator for cvec and svec.
cvec operator-(const cvec &a, const ivec &b)
Subtraction operator for cvec and ivec.
vec operator-(const float &s, const vec &v)
Subtraction operator for float and vec.
cvec operator+(const cvec &v, const short &s)
Addition operator for cvec and short.
cvec operator+(const cvec &v, const float &s)
Addition operator for cvec and float.
vec operator-(const vec &v, const short &s)
Subtraction operator for vec and short.
vec operator*(const short &s, const vec &v)
Multiplication operator for short and vec.
cvec operator+(const ivec &v, const std::complex< double > &s)
Addition operator for ivec and complex<double>
vec operator-(const ivec &a, const vec &b)
Subtraction operator for ivec and vec.
vec operator+(const vec &a, const ivec &b)
Addition operator for vec and ivec.
double operator*(const vec &a, const bvec &b)
Multiplication operator for vec and bvec.
vec operator-(const vec &a, const bvec &b)
Subtraction operator for vec and bvec.
cvec operator-(const int &s, const cvec &v)
Subtraction operator for int and cvec.
vec operator/(const vec &v, const int &s)
Division operator for vec and int.
cvec operator-(const cvec &v, const int &s)
Subtraction operator for cvec and int.
cvec operator-(const cvec &v, const double &s)
Subtraction operator for cvec and double.
cvec operator-(const bvec &a, const cvec &b)
Subtraction operator for bvec and cvec.
vec operator/(const vec &v, const short &s)
Division operator for vec and short.
vec operator+(const vec &a, const svec &b)
Addition operator for vec and svec.
vec operator*(const float &s, const vec &v)
Multiplication operator for float and vec.
cvec operator-(const cvec &a, const bvec &b)
Subtraction operator for cvec and bvec.
vec operator*(const int &s, const vec &v)
Multiplication operator for int and vec.
cvec operator+(const short &s, const cvec &v)
Addition operator for short and cvec.
cvec operator+(const cvec &v, const double &s)
Addition operator for cvec and double.
cvec operator*(const cvec &v, const int &s)
Multiplication operator for cvec and int.
cvec operator-(const cvec &v, const float &s)
Subtraction operator for cvec and float.
vec operator/(const vec &v, const float &s)
Division operator for vec and float.
cvec operator+(const cvec &a, const bvec &b)
Addition operator for cvec and bvec.
vec operator+(const float &s, const vec &v)
Addition operator for float and vec.
vec operator+(const vec &a, const bvec &b)
Addition operator for vec and bvec.
cvec operator+(const int &s, const cvec &v)
Addition operator for int and cvec.
vec operator+(const int &s, const vec &v)
Addition operator for int and vec.
cvec operator*(const ivec &v, const std::complex< double > &s)
Multiplication operator for ivec and complex<double>
cvec operator+(const cvec &a, const svec &b)
Addition operator for cvec and svec.
cvec operator-(const ivec &a, const cvec &b)
Subtraction operator for ivec and cvec.
double operator*(const vec &a, const svec &b)
Multiplication operator for vec and svec.
cvec operator-(const short &s, const cvec &v)
Subtraction operator for short and cvec.
cvec operator*(const int &s, const cvec &v)
Multiplication operator for int and cvec.
vec operator+(const vec &v, const int &s)
Addition operator for vec and int.
cvec operator*(const float &s, const cvec &v)
Multiplication operator for float and cvec.
vec operator-(const vec &a, const ivec &b)
Subtraction operator for vec and ivec.
vec operator-(const ivec &v, const double &s)
Subtraction operator for ivec and double.
Definitions of converters between different vector and matrix types.
Matrix Class Definitions.
Mat< bin > bmat
bin matrix
cmat to_cmat(const Mat< T > &m)
Converts a Mat<T> to cmat.
Mat< Num_T > operator-(const Mat< Num_T > &m1, const Mat< Num_T > &m2)
Subtraction of two matrices.
GF2mat operator*(const GF2mat &X, const GF2mat &Y)
GF(2) matrix multiplication.
Mat< Num_T > operator/(const Mat< Num_T > &m, Num_T t)
Element-wise division by a scalar.
GF2mat operator+(const GF2mat &X, const GF2mat &Y)
GF(2) matrix addition.
Templated Vector Class Definitions.