22 if(
n!=mat.
n ||
m!=mat.
m){
24 std::cerr <<
"These two matrises can not make a summation." << std::endl
25 <<
"Your input was" <<
"(" <<
m <<
"x"<<
n <<
","<<
kl <<
":"<<
ku <<
") "<<
"+=" <<
"("<< mat.
m <<
"x"<< mat.
n <<
","<< mat.
kl <<
":"<< mat.
ku <<
") " << std::endl;
31 for(CPPL_INT
i=0;
i<
m;
i++){
32 const CPPL_INT jmax =std::min(
n,
i+mat.
ku+1);
33 for(CPPL_INT j=std::max(CPPL_INT(0),
i-mat.
kl); j<jmax; j++){
44 for(CPPL_INT
i=0;
i<
m;
i++){
45 const CPPL_INT jmax1 =std::min(
n,
i+
ku+1);
46 for(CPPL_INT j=std::max(CPPL_INT(0),
i-
kl); j<jmax1; j++){
49 const CPPL_INT jmax2 =std::min(mat.
n,
i+mat.
ku+1);
50 for(CPPL_INT j=std::max(CPPL_INT(0),
i-mat.
kl); j<jmax2; j++){
51 newmat(
i,j) += mat(
i,j);
66 if(
n!=mat.
n ||
m!=mat.
m){
68 std::cerr <<
"These two matrises can not make a subtraction." << std::endl
69 <<
"Your input was" <<
"(" <<
m <<
"x"<<
n <<
","<<
kl <<
":"<<
ku <<
") "<<
"-=" <<
"("<< mat.
m <<
"x"<< mat.
n <<
","<< mat.
kl <<
":"<< mat.
ku <<
") " << std::endl;
75 for(CPPL_INT
i=0;
i<
m;
i++){
76 const CPPL_INT jmax =std::min(
n,
i+mat.
ku+1);
77 for(CPPL_INT j=std::max(CPPL_INT(0),
i-mat.
kl); j<jmax; j++){
88 for(CPPL_INT
i=0;
i<
m;
i++){
89 const CPPL_INT jmax1 =std::min(
n,
i+
ku+1);
90 for(CPPL_INT j=std::max(CPPL_INT(0),
i-
kl); j<jmax1; j++){
93 const CPPL_INT jmax2 =std::min(mat.
n,
i+mat.
ku+1);
94 for(CPPL_INT j=std::max(CPPL_INT(0),
i-mat.
kl); j<jmax2; j++){
95 newmat(
i,j) -= mat(
i,j);
107 {CPPL_VERBOSE_REPORT;
111 std::cerr <<
"These two matrises can not make a product." << std::endl
112 <<
"Your input was (" <<
m <<
"x" <<
n <<
") * (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
120 for(CPPL_INT
i=0;
i<newmat.
m;
i++){
121 const CPPL_INT jmax =std::min(newmat.
n,
i+newmat.
ku+1);
122 for(CPPL_INT j=std::max(CPPL_INT(0),
i-newmat.
kl); j<jmax; j++){
123 const CPPL_INT kmax =std::min( std::min(
n,
i+
ku+1), std::min(mat.
m,j+mat.
kl+1) );
124 for(CPPL_INT k=std::max( std::max(CPPL_INT(0),
i-
kl), std::max(CPPL_INT(0),j-mat.
ku) ); k<kmax; k++){
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);
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);
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);
comple & operator()(const CPPL_INT &, const CPPL_INT &)
friend _zgematrix i(const zgbmatrix &)
zgbmatrix & operator*=(const zgbmatrix &)
_dgematrix i(const _dgbmatrix &mat)
void copy(const zgbmatrix &)
zgbmatrix & operator+=(const zgbmatrix &)
_zgbmatrix operator+(const zgbmatrix &matA, const zgbmatrix &matB)
CPPL_INT n
matrix column size
_zgbmatrix operator*(const zgbmatrix &matA, const zgbmatrix &matB)
_zgbmatrix operator-(const zgbmatrix &matA, const zgbmatrix &matB)
CPPL_INT ku
upper band width
CPPL_INT m
matrix row size
zgbmatrix & operator=(const zgbmatrix &)
Complex Double-precision General Band Matrix Class.
zgbmatrix & operator-=(const zgbmatrix &)
(DO NOT USE) Smart-temporary Complex Double-precision General Band Matrix Class
CPPL_INT kl
lower band width
_dcovector _(dcovector &vec)
friend void swap(zgbmatrix &, zgbmatrix &)
comple * array
1D array to store matrix data