CPPLapack
 All Classes Files Functions Variables Friends
Functions
zgsmatrix-zcovector.hpp File Reference

Go to the source code of this file.

Functions

_zcovector operator* (const zgsmatrix &mat, const zcovector &vec)

Function Documentation

_zcovector operator* ( const zgsmatrix mat,
const zcovector vec 
) [inline]

zgsmatrix*zcovector operator

Definition at line 3 of file zgsmatrix-zcovector.hpp.

References _(), zgsmatrix::data, zcovector::l, zgsmatrix::m, zgsmatrix::n, and zcovector::zero().

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if(mat.n!=vec.l){
    ERROR_REPORT;
    std::cerr << "These matrix and vector can not make a product." << std::endl
              << "Your input was (" << mat.m << "x" << mat.n << ") * (" << vec.l << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  zcovector newvec(mat.m);
  newvec.zero();
  
  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
    newvec(it->i) += it->v*vec(it->j);
  }
  
  return _(newvec);
}
 All Classes Files Functions Variables Friends