CPPLapack
 All Classes Files Functions Variables Friends Pages
Functions
zgematrix-zgbmatrix.hpp File Reference

Go to the source code of this file.

Functions

_zgematrix operator+ (const zgematrix &matA, const zgbmatrix &matB)
 
_zgematrix operator- (const zgematrix &matA, const zgbmatrix &matB)
 
_zgematrix operator* (const zgematrix &matA, const zgbmatrix &matB)
 

Function Documentation

_zgematrix operator+ ( const zgematrix matA,
const zgbmatrix matB 
)
inline

zgematrix+zgbmatrix operator

Definition at line 80 of file zgematrix-zgbmatrix.hpp.

References _(), i(), zgbmatrix::kl, zgbmatrix::ku, zgbmatrix::m, zgematrix::m, zgematrix::n, and zgbmatrix::n.

81 {CPPL_VERBOSE_REPORT;
82 #ifdef CPPL_DEBUG
83  if(matA.n!=matB.n || matA.m!=matB.m){
84  ERROR_REPORT;
85  std::cerr << "These two matrises can not make a summation." << std::endl
86  << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
87  exit(1);
88  }
89 #endif//CPPL_DEBUG
90 
91  zgematrix newmat(matA);
92 
93  for(CPPL_INT i=0; i<matB.m; i++){
94  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
95  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
96  newmat(i,j) += matB(i,j);
97  }
98  }
99 
100  return _(newmat);
101 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zgbmatrix.hpp:10
CPPL_INT ku
upper band width
Definition: zgbmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: zgbmatrix.hpp:9
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
CPPL_INT kl
lower band width
Definition: zgbmatrix.hpp:11
_dcovector _(dcovector &vec)
_zgematrix operator- ( const zgematrix matA,
const zgbmatrix matB 
)
inline

zgematrix-zgbmatrix operator

Definition at line 105 of file zgematrix-zgbmatrix.hpp.

References _(), i(), zgbmatrix::kl, zgbmatrix::ku, zgbmatrix::m, zgematrix::m, zgematrix::n, and zgbmatrix::n.

106 {CPPL_VERBOSE_REPORT;
107 #ifdef CPPL_DEBUG
108  if(matA.n!=matB.n || matA.m!=matB.m){
109  ERROR_REPORT;
110  std::cerr << "These two matrises can not make a summation." << std::endl
111  << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
112  exit(1);
113  }
114 #endif//CPPL_DEBUG
115 
116  zgematrix newmat(matA);
117 
118  for(CPPL_INT i=0; i<matB.m; i++){
119  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
120  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
121  newmat(i,j) -= matB(i,j);
122  }
123  }
124 
125  return _(newmat);
126 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zgbmatrix.hpp:10
CPPL_INT ku
upper band width
Definition: zgbmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: zgbmatrix.hpp:9
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
CPPL_INT kl
lower band width
Definition: zgbmatrix.hpp:11
_dcovector _(dcovector &vec)
_zgematrix operator* ( const zgematrix matA,
const zgbmatrix matB 
)
inline

zgematrix*zgbmatrix operator

Definition at line 130 of file zgematrix-zgbmatrix.hpp.

References _(), i(), zgbmatrix::kl, zgbmatrix::ku, zgbmatrix::m, zgematrix::m, zgematrix::n, zgbmatrix::n, and zgematrix::zero().

131 {CPPL_VERBOSE_REPORT;
132 #ifdef CPPL_DEBUG
133  if(matA.n!=matB.m){
134  ERROR_REPORT;
135  std::cerr << "These two matrises can not make a product." << std::endl
136  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
137  exit(1);
138  }
139 #endif//CPPL_DEBUG
140 
141  zgematrix newmat( matA.m, matB.n );
142  newmat.zero();
143 
144  for(CPPL_INT i=0; i<newmat.m; i++){
145  for(CPPL_INT j=0; j<newmat.n; j++){
146  const CPPL_INT kmax =std::min(matB.m,j+matB.kl+1);
147  for(CPPL_INT k=std::max(CPPL_INT(0),j-matB.ku); k<kmax; k++){
148  newmat(i,j) += matA(i,k)*matB(k,j);
149  }
150  }
151  }
152 
153  return _(newmat);
154 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zgbmatrix.hpp:10
CPPL_INT ku
upper band width
Definition: zgbmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: _dgematrix.hpp:9
CPPL_INT m
matrix row size
Definition: zgbmatrix.hpp:9
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
CPPL_INT kl
lower band width
Definition: zgbmatrix.hpp:11
_dcovector _(dcovector &vec)