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