00001
00003 inline dssmatrix& dssmatrix::operator*=(const double& d)
00004 {
00005 #ifdef CPPL_VERBOSE
00006 std::cerr << "# [MARK] dssmatrix::operator*=(const double&)"
00007 << std::endl;
00008 #endif//CPPL_VERBOSE
00009
00010 dscal_(VOL, d, Array, 1);
00011 return *this;
00012 }
00013
00014
00016 inline dssmatrix& dssmatrix::operator/=(const double& d)
00017 {
00018 #ifdef CPPL_VERBOSE
00019 std::cerr << "# [MARK] dssmatrix::operator/=(const double&)"
00020 << std::endl;
00021 #endif//CPPL_VERBOSE
00022
00023 dscal_(VOL, 1./d, Array, 1);
00024 return *this;
00025 }
00026
00030
00031
00033 inline _dssmatrix operator*(const dssmatrix& mat, const double& d)
00034 {
00035 #ifdef CPPL_VERBOSE
00036 std::cerr << "# [MARK] operator*(const dssmatrix&, const double&)"
00037 << std::endl;
00038 #endif//CPPL_VERBOSE
00039
00040 dssmatrix newmat(mat.M, mat.N, mat.CAP);
00041
00042 for(long c=0; c<mat.VOL; c++){
00043 newmat.fput(mat.Indx[c], mat.Jndx[c], mat.Array[c]*d);
00044 }
00045
00046 return _(newmat);
00047 }
00048
00049
00051 inline _dssmatrix operator/(const dssmatrix& mat, const double& d)
00052 {
00053 #ifdef CPPL_VERBOSE
00054 std::cerr << "# [MARK] operator/(const dssmatrix&, const double&)"
00055 << std::endl;
00056 #endif//CPPL_VERBOSE
00057
00058 double inv_d(1./d);
00059 dssmatrix newmat(mat.M, mat.N, mat.CAP);
00060
00061 for(long c=0; c<mat.VOL; c++){
00062 newmat.fput(mat.Indx[c], mat.Jndx[c], mat.Array[c]*inv_d);
00063 }
00064
00065 return _(newmat);
00066 }