Go to the source code of this file.
_zgbmatrix+zgbmatrix operator
Definition at line 3 of file _zgbmatrix-zgbmatrix.hpp.
References _(), _zgbmatrix::destroy(), i(), _zgbmatrix::kl, zgbmatrix::kl, zgbmatrix::ku, _zgbmatrix::ku, _zgbmatrix::m, zgbmatrix::m, zgbmatrix::n, _zgbmatrix::n, and zgbmatrix::zero().
6 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
8 std::cerr <<
"These two matrises can not make a summation." << std::endl
9 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") + (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
14 if(matA.
kl>=matB.
kl && matA.
ku>=matB.
ku){
15 for(CPPL_INT
i=0;
i<matB.
m;
i++){
16 const CPPL_INT jmax =std::min(matB.
n,
i+matB.
ku+1);
17 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matB.
kl); j<jmax; j++){
18 matA(
i,j) += matB(
i,j);
29 for(CPPL_INT
i=0;
i<matA.
m;
i++){
30 const CPPL_INT jmax1 =std::min(matA.
n,
i+matA.
ku+1);
31 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matA.
kl); j<jmax1; j++){
32 newmat(
i,j) += matA(
i,j);
34 const CPPL_INT jmax2 =std::min(matB.
n,
i+matB.
ku+1);
35 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matB.
kl); j<jmax2; j++){
36 newmat(
i,j) += matB(
i,j);
CPPL_INT ku
upper band width
CPPL_INT kl
lower band width
_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
CPPL_INT m
matrix row size
CPPL_INT n
matrix column size
_dcovector _(dcovector &vec)
_zgbmatrix-zgbmatrix operator
Definition at line 47 of file _zgbmatrix-zgbmatrix.hpp.
References _(), i(), _zgbmatrix::kl, zgbmatrix::kl, zgbmatrix::ku, _zgbmatrix::ku, _zgbmatrix::m, zgbmatrix::m, zgbmatrix::n, _zgbmatrix::n, and zgbmatrix::zero().
50 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
52 std::cerr <<
"These two matrises can not make a subtraction." << std::endl
53 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") - (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
58 if(matA.
kl>=matB.
kl && matA.
ku>=matB.
ku){
59 for(CPPL_INT
i=0;
i<matB.
m;
i++){
60 const CPPL_INT jmax =std::min(matB.
n,
i+matB.
ku+1);
61 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matB.
kl); j<jmax; j++){
62 matA(
i,j) -= matB(
i,j);
73 for(CPPL_INT
i=0;
i<matA.
m;
i++){
74 const CPPL_INT jmax1 =std::min(matA.
n,
i+matA.
ku+1);
75 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matA.
kl); j<jmax1; j++){
76 newmat(
i,j) += matA(
i,j);
78 const CPPL_INT jmax2 =std::min(matB.
n,
i+matB.
ku+1);
79 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matB.
kl); j<jmax2; j++){
80 newmat(
i,j) -= matB(
i,j);
CPPL_INT ku
upper band width
CPPL_INT kl
lower band width
_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
CPPL_INT m
matrix row size
CPPL_INT n
matrix column size
_dcovector _(dcovector &vec)
_zgbmatrix*zgbmatrix operator
Definition at line 90 of file _zgbmatrix-zgbmatrix.hpp.
References _(), _zgbmatrix::destroy(), i(), _zgbmatrix::kl, zgbmatrix::kl, zgbmatrix::ku, _zgbmatrix::ku, zgbmatrix::m, _zgbmatrix::m, zgbmatrix::n, _zgbmatrix::n, and zgbmatrix::zero().
95 std::cerr <<
"These two matrises can not make a product." << std::endl
96 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") * (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
101 zgbmatrix newmat( matA.
m, matB.
n, std::min(matA.
kl+matB.
kl,matA.
m-1), std::min(matA.
ku+matB.
ku,matB.
n-1) );
104 for(CPPL_INT
i=0;
i<newmat.
m;
i++){
105 const CPPL_INT jmax =std::min(newmat.n,
i+newmat.ku+1);
106 for(CPPL_INT j=std::max(CPPL_INT(0),
i-newmat.kl); j<jmax; j++){
107 const CPPL_INT kmax =std::min( std::min(matA.
n,
i+matA.
ku+1), std::min(matB.
m,j+matB.
kl+1) );
108 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++){
109 newmat(
i,j) += matA(
i,k)*matB(k,j);
CPPL_INT ku
upper band width
CPPL_INT kl
lower band width
_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
CPPL_INT m
matrix row size
CPPL_INT n
matrix column size
_dcovector _(dcovector &vec)