Go to the source code of this file.
Functions | |
_zgematrix | operator+ (const zgematrix &matA, const _zgsmatrix &matB) |
_zgematrix | operator- (const zgematrix &matA, const _zgsmatrix &matB) |
_zgematrix | operator* (const zgematrix &matA, const _zgsmatrix &matB) |
_zgematrix operator+ | ( | const zgematrix & | matA, |
const _zgsmatrix & | matB | ||
) | [inline] |
zgematrix+_zgsmatrix operator
Definition at line 3 of file zgematrix-_zgsmatrix.hpp.
References _(), _zgsmatrix::data, _zgsmatrix::destroy(), zcomponent::i, zcomponent::j, zgematrix::m, _zgsmatrix::m, _zgsmatrix::n, zgematrix::n, and zcomponent::v.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.m!=matB.m || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat(matA); for(size_t c=0; c<matB.data.size(); c++){ const zcomponent& z =matB.data[c]; newmat(z.i,z.j) += z.v; } matB.destroy(); return _(newmat); }
_zgematrix operator- | ( | const zgematrix & | matA, |
const _zgsmatrix & | matB | ||
) | [inline] |
zgematrix-_zgsmatrix operator
Definition at line 26 of file zgematrix-_zgsmatrix.hpp.
References _(), _zgsmatrix::data, _zgsmatrix::destroy(), zcomponent::i, zcomponent::j, zgematrix::m, _zgsmatrix::m, _zgsmatrix::n, zgematrix::n, and zcomponent::v.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.m!=matB.m || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat(matA); for(size_t c=0; c<matB.data.size(); c++){ const zcomponent& z =matB.data[c]; newmat(z.i,z.j) -= z.v; } matB.destroy(); return _(newmat); }
_zgematrix operator* | ( | const zgematrix & | matA, |
const _zgsmatrix & | matB | ||
) | [inline] |
zgematrix*_zgsmatrix operator
Definition at line 49 of file zgematrix-_zgsmatrix.hpp.
References _(), _zgsmatrix::data, _zgsmatrix::destroy(), zcomponent::i, i(), zcomponent::j, _zgsmatrix::m, zgematrix::m, _zgsmatrix::n, zgematrix::n, zcomponent::v, and zgematrix::zero().
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a product." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat(matA.m, matB.n); newmat.zero(); for(size_t c=0; c<matB.data.size(); c++){ const zcomponent& z =matB.data[c]; for(long i=0; i<matA.m; i++){ newmat(i,z.j) += matA(i,z.i)*z.v; } } matB.destroy(); return _(newmat); }