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