VERB_code_2.3
dssmatrix-_dcovector.hpp
1 //=============================================================================
3 inline _dcovector operator*(const dssmatrix& mat, const _dcovector& vec)
4 {
5 #ifdef CPPL_VERBOSE
6  std::cerr << "# [MARK] operator*(const dssmatrix&, const _dcovector&)"
7  << std::endl;
8 #endif//CPPL_VERBOSE
9 
10 #ifdef CPPL_DEBUG
11  if(mat.N!=vec.L){
12  std::cerr << "[ERROR] operator*(const dssmatrix&, const _dcovector&)"
13  << std::endl
14  << "These matrix and vector can not make a product." << std::endl
15  << "Your input was (" << mat.M << "x" << mat.N << ") * ("
16  << vec.L << ")." << std::endl;
17  exit(1);
18  }
19 #endif//CPPL_DEBUG
20 
21  dcovector newvec(mat.M);
22  newvec.zero();
23 
24  for(int c=0; c<mat.VOL; c++){
25  newvec(mat.Indx[c]) +=mat.Array[c]*vec(mat.Jndx[c]);
26  }
27 
28  vec.destroy();
29  return _(newvec);
30 }
long L
vector size
Definition: _dcovector.hpp:7
void destroy() const
Definition: _dcovector-misc.hpp:3
friend _drovector operator*(const drovector &, const dgematrix &)
Definition: drovector-dgematrix.hpp:3
Real Double-precision Column Vector Class.
Definition: dcovector.hpp:3
Real Double-precision Sparse Matrix Class.
Definition: dssmatrix.hpp:3
void zero()
Definition: dcovector-misc.hpp:23
(DO NOT USE) Smart-temporary Real Double-precision Column Vector Class
Definition: _dcovector.hpp:3