My Project
zgbmatrix-double.hpp
1 //=============================================================================
3 inline zgbmatrix& zgbmatrix::operator*=(const double& d)
4 {
5 #ifdef CPPL_VERBOSE
6  std::cerr << "# [MARK] zgbmatrix::operator*=(const double&)"
7  << std::endl;
8 #endif//CPPL_VERBOSE
9 
10  zdscal_((KL+KU+1)*N, d, Array, 1);
11  return *this;
12 }
13 
14 //=============================================================================
16 inline zgbmatrix& zgbmatrix::operator/=(const double& d)
17 {
18 #ifdef CPPL_VERBOSE
19  std::cerr << "# [MARK] zgbmatrix::operator/=(const double&)"
20  << std::endl;
21 #endif//CPPL_VERBOSE
22 
23  zdscal_((KL+KU+1)*N, 1./d, Array, 1);
24  return *this;
25 }
26 
30 
31 //=============================================================================
33 inline _zgbmatrix operator*(const zgbmatrix& mat, const double& d)
34 {
35 #ifdef CPPL_VERBOSE
36  std::cerr << "# [MARK] operator*(const zgbmatrix&, const double&)"
37  << std::endl;
38 #endif//CPPL_VERBOSE
39 
40  zgbmatrix newmat(mat.M, mat.N, mat.KL, mat.KU);
41  for(long i=0; i<(newmat.kl+newmat.ku+1)*newmat.n; i++){
42  newmat.array[i] =mat.Array[i]*d;
43  }
44 
45  return _(newmat);
46 }
47 
48 //=============================================================================
50 inline _zgbmatrix operator/(const zgbmatrix& mat, const double& d)
51 {
52 #ifdef CPPL_VERBOSE
53  std::cerr << "# [MARK] operator/(const zgbmatrix&, const double&)"
54  << std::endl;
55 #endif//CPPL_VERBOSE
56 
57  double inv_d(1./d);
58 
59  zgbmatrix newmat(mat.M, mat.N, mat.KL, mat.KU);
60  for(long i=0; i<(newmat.kl+newmat.ku+1)*newmat.n; i++){
61  newmat.array[i] =d*mat.Array[i]*inv_d;
62  }
63 
64  return _(newmat);
65 }
std::complex< double > *const & array
1D array to store matrix data (readable)
Definition: zgbmatrix.hpp:20
zgbmatrix & operator*=(const zgbmatrix &)
Definition: zgbmatrix-zgbmatrix.hpp:121
friend _zrovector operator/(const zrovector &, const double &)
Definition: zrovector-double.hpp:48
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
zgbmatrix & operator/=(const double &)
Definition: zgbmatrix-double.hpp:16
friend _zrovector operator*(const zrovector &, const zgematrix &)
Definition: zrovector-zgematrix.hpp:3
(DO NOT USE) Smart-temporary Complex Double-precision General Band Matrix Class
Definition: _zgbmatrix.hpp:3
long const & kl
lower band width (readable)
Definition: zgbmatrix.hpp:18
long const & n
matrix column size (readable)
Definition: zgbmatrix.hpp:17
long const & ku
upper band width (readable)
Definition: zgbmatrix.hpp:19
std::complex< double > * Array
1D Array to store vector data
Definition: _zrovector.hpp:8