VERB_code_2.3
zgematrix-double.hpp
1 //=============================================================================
3 inline zgematrix& zgematrix::operator*=(const double& d)
4 {
5 #ifdef CPPL_VERBOSE
6  std::cerr << "# [MARK] zgematrix::operator*=(const double&)"
7  << std::endl;
8 #endif//CPPL_VERBOSE
9 
10  zdscal_(M*N, d, Array, 1);
11  return *this;
12 }
13 
14 //=============================================================================
16 inline zgematrix& zgematrix::operator/=(const double& d)
17 {
18 #ifdef CPPL_VERBOSE
19  std::cerr << "# [MARK] zgematrix::operator/=(const double&)"
20  << std::endl;
21 #endif//CPPL_VERBOSE
22 
23  zdscal_(M*N, 1./d, Array, 1);
24  return *this;
25 }
26 
30 
31 //=============================================================================
33 inline _zgematrix operator*(const zgematrix& mat, const double& d)
34 {
35 #ifdef CPPL_VERBOSE
36  std::cerr << "# [MARK] operator*(const zgematrix&, const double&)"
37  << std::endl;
38 #endif//CPPL_VERBOSE
39 
40  zgematrix newmat(mat.M, mat.N);
41  for(long i=0; i<mat.M*mat.N; i++){ newmat.array[i] =mat.Array[i]*d; }
42 
43  return _(newmat);
44 }
45 
46 //=============================================================================
48 inline _zgematrix operator/(const zgematrix& mat, const double& d)
49 {
50 #ifdef CPPL_VERBOSE
51  std::cerr << "# [MARK] operator/(const zgematrix&, const double&)"
52  << std::endl;
53 #endif//CPPL_VERBOSE
54 
55  double inv_d(1./d);
56 
57  zgematrix newmat(mat.M, mat.N);
58  for(long i=0; i<mat.M*mat.N; i++){ newmat.array[i] =mat.Array[i]*inv_d; }
59 
60  return _(newmat);
61 }
zgematrix & operator/=(const double &)
Definition: zgematrix-double.hpp:16
friend _zrovector operator/(const zrovector &, const double &)
Definition: zrovector-double.hpp:48
zgematrix & operator*=(const zgematrix &)
Definition: zgematrix-zgematrix.hpp:68
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
(DO NOT USE) Smart-temporary Complex Double-precision General Dence Matrix Class
Definition: _zgematrix.hpp:3
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
std::complex< double > *const & array
1D array to store matrix data (readable)
Definition: zgematrix.hpp:16