00001
00003 inline _zrovector operator*(const zrovector& vec, const zssmatrix& mat)
00004 {
00005 #ifdef CPPL_VERBOSE
00006 std::cerr << "# [MARK] operator*(const zrovector&, const zssmatrix&)"
00007 << std::endl;
00008 #endif//CPPL_VERBOSE
00009
00010 #ifdef CPPL_DEBUG
00011 if(vec.L!=mat.M){
00012 std::cerr << "[ERROR] operator*(const zrovector&, const zssmatrix&)"
00013 << std::endl
00014 << "These vector and matrix can not make a product."
00015 << std::endl
00016 << "Your input was (" << vec.L << ") * ("
00017 << mat.M << "x" << mat.N << ")." << std::endl;
00018 exit(1);
00019 }
00020 #endif//CPPL_DEBUG
00021
00022 zrovector newvec(mat.N);
00023 newvec.zero();
00024
00025 for(int c=0; c<mat.VOL; c++){
00026 newvec(mat.Jndx[c]) +=vec(mat.Indx[c])*mat.Array[c];
00027 }
00028
00029 return _(newvec);
00030 }