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