Go to the source code of this file.
Functions | |
_zrovector | operator* (const _zrovector &vec, const zgsmatrix &mat) |
_zrovector operator* | ( | const _zrovector & | vec, |
const zgsmatrix & | mat | ||
) | [inline] |
_zrovector*zgsmatrix operator
Definition at line 3 of file _zrovector-zgsmatrix.hpp.
References _(), zgsmatrix::data, _zrovector::destroy(), _zrovector::l, zgsmatrix::m, zgsmatrix::n, and zrovector::zero().
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vec.l!=mat.m){ ERROR_REPORT; std::cerr << "These vector and matrix can not make a product." << std::endl << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zrovector newvec(mat.n); newvec.zero(); for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){ newvec(it->j) += vec(it->i)*it->v; } vec.destroy(); return _(newvec); }