//=============================================================================
/*! _dgematrix*dssmatrix operator */
inline _dgematrix operator*(const _dgematrix& matA, const dssmatrix& matB)
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] operator*(const _dgematrix&, const dssmatrix&)" << std::endl;
#endif//CPPL_VERBOSE
#ifdef CPPL_DEBUG
if(matA.N!=matB.m){
std::cerr << "[ERROR] operator*(const _dgematrix&, const dssmatrix&)" << std::endl
<< "These two matrises can not make a product." << std::endl
<< "Your input was (" << matA.M << "x" << matA.N << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
exit(1);
}
#endif//CPPL_DEBUG
dgematrix newmat(matA.M, matB.N);
newmat.zero();
double *ap(matB.array);
long *kp(matB.indx), *jp(matB.jndx), c(0);
while(c<matB.vol){
for(long i=0; i<matA.M; i++){
newmat(i,*jp) +=matA(i,*kp)*(*ap);
}
if((*kp)!=(*jp)){
for(long i=0; i<matA.M; i++){
newmat(i,*kp) +=matA(i,*jp)*(*ap);
}
}
ap++; kp++; jp++; c++;
}
matA.destroy();
return _(newmat);
}