//=============================================================================
/*! dgsmatrix*=double operator */
inline dgsmatrix& dgsmatrix::operator*=(const double& d)
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] dgsmatrix::operator*=(const double&)"
<< std::endl;
#endif//CPPL_VERBOSE
dscal_(VOL, d, Array, 1);
return *this;
}
//=============================================================================
/*! dgsmatrix/=double operator */
inline dgsmatrix& dgsmatrix::operator/=(const double& d)
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] dgsmatrix::operator/=(const double&)"
<< std::endl;
#endif//CPPL_VERBOSE
dscal_(VOL, 1./d, Array, 1);
return *this;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//=============================================================================
/*! dgsmatrix*double operator */
inline _dgsmatrix operator*(const dgsmatrix& mat, const double& d)
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] operator*(const dgsmatrix&, const double&)"
<< std::endl;
#endif//CPPL_VERBOSE
dgsmatrix newmat(mat.M, mat.N, mat.CAP);
for(long c=0; c<mat.VOL; c++){
newmat.fput(mat.Indx[c], mat.Jndx[c], mat.Array[c]*d);
}
return _(newmat);
}
//=============================================================================
/*! dgsmatrix/double operator */
inline _dgsmatrix operator/(const dgsmatrix& mat, const double& d)
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] operator/(const dgsmatrix&, const double&)"
<< std::endl;
#endif//CPPL_VERBOSE
double inv_d(1./d);
dgsmatrix newmat(mat.M, mat.N, mat.CAP);
for(long c=0; c<mat.VOL; c++){
newmat.fput(mat.Indx[c], mat.Jndx[c], mat.Array[c]*inv_d);
}
return _(newmat);
}