//=============================================================================
/*! zgsmatrix*=double operator */
inline zgsmatrix& zgsmatrix::operator*=(const double& d)
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] zgsmatrix::operator*=(const double&)" << std::endl;
#endif//CPPL_VERBOSE
zdscal_(VOL, d, Array, 1);
return *this;
}
//=============================================================================
/*! zgsmatrix/=double operator */
inline zgsmatrix& zgsmatrix::operator/=(const double& d)
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] zgsmatrix::operator/=(const double&)" << std::endl;
#endif//CPPL_VERBOSE
zdscal_(VOL, 1./d, Array, 1);
return *this;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//=============================================================================
/*! zgsmatrix*double operator */
inline _zgsmatrix operator*(const zgsmatrix& mat, const double& d)
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] operator*(const zgsmatrix&, const double&)" << std::endl;
#endif//CPPL_VERBOSE
zgsmatrix 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);
}
//=============================================================================
/*! zgsmatrix/double operator */
inline _zgsmatrix operator/(const zgsmatrix& mat, const double& d)
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] operator/(const zgsmatrix&, const double&)" << std::endl;
#endif//CPPL_VERBOSE
const double inv_d(1./d);
zgsmatrix 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);
}