VERB_code_2.3
zssmatrix-double.hpp
1 //=============================================================================
3 inline zssmatrix& zssmatrix::operator*=(const double& d)
4 {
5 #ifdef CPPL_VERBOSE
6  std::cerr << "# [MARK] zssmatrix::operator*=(const double&)"
7  << std::endl;
8 #endif//CPPL_VERBOSE
9 
10  zdscal_(VOL, d, Array, 1);
11  return *this;
12 }
13 
14 //=============================================================================
16 inline zssmatrix& zssmatrix::operator/=(const double& d)
17 {
18 #ifdef CPPL_VERBOSE
19  std::cerr << "# [MARK] zssmatrix::operator/=(const double&)"
20  << std::endl;
21 #endif//CPPL_VERBOSE
22 
23  zdscal_(VOL, 1./d, Array, 1);
24  return *this;
25 }
26 
30 
31 //=============================================================================
33 inline _zssmatrix operator*(const zssmatrix& mat, const double& d)
34 {
35 #ifdef CPPL_VERBOSE
36  std::cerr << "# [MARK] operator*(const zssmatrix&, const double&)"
37  << std::endl;
38 #endif//CPPL_VERBOSE
39 
40  zssmatrix newmat(mat.M, mat.N, mat.CAP);
41 
42  for(long c=0; c<mat.VOL; c++){
43  newmat.fput(mat.Indx[c], mat.Jndx[c], mat.Array[c]*d);
44  }
45 
46  return _(newmat);
47 }
48 
49 //=============================================================================
51 inline _zssmatrix operator/(const zssmatrix& mat, const double& d)
52 {
53 #ifdef CPPL_VERBOSE
54  std::cerr << "# [MARK] operator/(const zssmatrix&, const double&)"
55  << std::endl;
56 #endif//CPPL_VERBOSE
57 
58  double inv_d(1./d);
59  zssmatrix newmat(mat.M, mat.N, mat.CAP);
60  for(long c=0; c<mat.VOL; c++){
61  newmat.fput(mat.Indx[c], mat.Jndx[c], mat.Array[c]*inv_d);
62  }
63 
64  return _(newmat);
65 }
void fput(const long &, const long &, const std::complex< double > &)
Definition: zssmatrix-io.hpp:75
(DO NOT USE) Smart-temporary Complex Double-precision Sparse Matrix Class
Definition: _zssmatrix.hpp:3
zssmatrix & operator/=(const double &)
Definition: zssmatrix-double.hpp:16
friend _zrovector operator/(const zrovector &, const double &)
Definition: zrovector-double.hpp:48
zssmatrix & operator*=(const zssmatrix &)
Definition: zssmatrix-zssmatrix.hpp:74
friend _zrovector operator*(const zrovector &, const zgematrix &)
Definition: zrovector-zgematrix.hpp:3
std::complex< double > * Array
1D Array to store vector data
Definition: _zrovector.hpp:8
Complex Double-precision Sparse Matrix Class.
Definition: zssmatrix.hpp:3