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