Go to the source code of this file.
zgbmatrix+zgbmatrix operator
Definition at line 140 of file zgbmatrix-zgbmatrix.hpp.
References _(), i(), zgbmatrix::kl, zgbmatrix::ku, zgbmatrix::m, zgbmatrix::n, and zgbmatrix::zero().
141 {CPPL_VERBOSE_REPORT;
143 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
145 std::cerr <<
"These two matrises can not make a summation." << std::endl
146 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") + (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
154 for(CPPL_INT
i=0;
i<matA.
m;
i++){
155 const CPPL_INT jmax1 =std::min(matA.
n,
i+matA.
ku+1);
156 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matA.
kl); j<jmax1; j++){
157 newmat(
i,j) += matA(
i,j);
159 const CPPL_INT jmax2 =std::min(matB.
n,
i+matB.
ku+1);
160 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matB.
kl); j<jmax2; j++){
161 newmat(
i,j) += matB(
i,j);
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
CPPL_INT ku
upper band width
CPPL_INT m
matrix row size
Complex Double-precision General Band Matrix Class.
CPPL_INT kl
lower band width
_dcovector _(dcovector &vec)
zgbmatrix-zgbmatrix operator
Definition at line 170 of file zgbmatrix-zgbmatrix.hpp.
References _(), i(), zgbmatrix::kl, zgbmatrix::ku, zgbmatrix::m, zgbmatrix::n, and zgbmatrix::zero().
171 {CPPL_VERBOSE_REPORT;
173 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
175 std::cerr <<
"These two matrises can not make a subtraction." << std::endl
176 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") - (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
184 for(CPPL_INT
i=0;
i<matA.
m;
i++){
185 const CPPL_INT jmax1 =std::min(matA.
n,
i+matA.
ku+1);
186 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matA.
kl); j<jmax1; j++){
187 newmat(
i,j) += matA(
i,j);
189 const CPPL_INT jmax2 =std::min(matB.
n,
i+matB.
ku+1);
190 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matB.
kl); j<jmax2; j++){
191 newmat(
i,j) -= matB(
i,j);
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
CPPL_INT ku
upper band width
CPPL_INT m
matrix row size
Complex Double-precision General Band Matrix Class.
CPPL_INT kl
lower band width
_dcovector _(dcovector &vec)
zgbmatrix*zgbmatrix operator
Definition at line 200 of file zgbmatrix-zgbmatrix.hpp.
References _(), i(), zgbmatrix::kl, zgbmatrix::ku, zgbmatrix::m, zgbmatrix::n, and zgbmatrix::zero().
201 {CPPL_VERBOSE_REPORT;
205 std::cerr <<
"These two matrises can not make a product." << std::endl
206 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") * (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
211 zgbmatrix newmat( matA.
m, matB.
n, std::min(matA.
kl+matB.
kl,matA.
m-1), std::min(matA.
ku+matB.
ku,matB.
n-1) );
214 for(CPPL_INT
i=0;
i<newmat.
m;
i++){
215 const CPPL_INT jmax =std::min(newmat.n,
i+newmat.ku+1);
216 for(CPPL_INT j=std::max(CPPL_INT(0),
i-newmat.kl); j<jmax; j++){
217 const CPPL_INT kmax =std::min( std::min(matA.
n,
i+matA.
ku+1), std::min(matB.
m,j+matB.
kl+1) );
218 for(CPPL_INT k=std::max( std::max(CPPL_INT(0),
i-matA.
kl), std::max(CPPL_INT(0),j-matB.
ku) ); k<kmax; k++){
219 newmat(
i,j) += matA(
i,k)*matB(k,j);
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
CPPL_INT ku
upper band width
CPPL_INT m
matrix row size
CPPL_INT m
matrix row size
Complex Double-precision General Band Matrix Class.
CPPL_INT kl
lower band width
_dcovector _(dcovector &vec)