Go to the source code of this file.
dgbmatrix+_dgbmatrix operator
Definition at line 140 of file dgbmatrix-_dgbmatrix.hpp.
References _(), _dgbmatrix::destroy(), i(), _dgbmatrix::kl, dgbmatrix::kl, dgbmatrix::ku, _dgbmatrix::ku, dgbmatrix::m, _dgbmatrix::m, _dgbmatrix::n, dgbmatrix::n, and dgbmatrix::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;
151 if(matB.
kl>matA.
kl && matB.
ku>matA.
ku){
152 for(CPPL_INT
i=0;
i<matA.
m;
i++){
153 const CPPL_INT jmax =std::min(matA.
n,
i+matA.
ku+1);
154 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matA.
kl); j<jmax; j++){
155 matB(
i,j)+=matA(
i,j);
165 for(CPPL_INT
i=0;
i<matA.
m;
i++){
166 const CPPL_INT jmax1 =std::min(matA.
n,
i+matA.
ku+1);
167 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matA.
kl); j<jmax1; j++){
168 newmat(
i,j)+=matA(
i,j);
170 const CPPL_INT jmax2 =std::min(matB.
n,
i+matB.
ku+1);
171 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matB.
kl); j<jmax2; j++){
172 newmat(
i,j)+=matB(
i,j);
CPPL_INT m
matrix row size
CPPL_INT ku
upper band width
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT kl
lower band width
CPPL_INT kl
lower band width
CPPL_INT ku
upper band width
CPPL_INT n
matrix column size
Real Double-precision General Band Matrix Class.
CPPL_INT n
matrix column size
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size
dgbmatrix-_dgbmatrix operator
Definition at line 183 of file dgbmatrix-_dgbmatrix.hpp.
References _(), _dgbmatrix::destroy(), i(), dgbmatrix::kl, _dgbmatrix::kl, _dgbmatrix::ku, dgbmatrix::ku, dgbmatrix::m, _dgbmatrix::m, _dgbmatrix::n, dgbmatrix::n, and dgbmatrix::zero().
184 {CPPL_VERBOSE_REPORT;
186 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
188 std::cerr <<
"These two matrises can not make a subtraction." << std::endl
189 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") - (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
197 for(CPPL_INT
i=0;
i<matA.
m;
i++){
198 const CPPL_INT jmax1 =std::min(matA.
n,
i+matA.
ku+1);
199 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matA.
kl); j<jmax1; j++){
200 newmat(
i,j)+=matA(
i,j);
202 const CPPL_INT jmax2 =std::min(matB.
n,
i+matB.
ku+1);
203 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matB.
kl); j<jmax2; j++){
204 newmat(
i,j)-=matB(
i,j);
CPPL_INT m
matrix row size
CPPL_INT ku
upper band width
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT kl
lower band width
CPPL_INT kl
lower band width
CPPL_INT ku
upper band width
CPPL_INT n
matrix column size
Real Double-precision General Band Matrix Class.
CPPL_INT n
matrix column size
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size
dgbmatrix*_dgbmatrix operator
Definition at line 214 of file dgbmatrix-_dgbmatrix.hpp.
References _(), _dgbmatrix::destroy(), i(), dgbmatrix::kl, _dgbmatrix::kl, _dgbmatrix::ku, dgbmatrix::ku, _dgbmatrix::m, dgbmatrix::m, _dgbmatrix::n, dgbmatrix::n, and dgbmatrix::zero().
215 {CPPL_VERBOSE_REPORT;
219 std::cerr <<
"These two matrises can not make a product." << std::endl
220 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") * (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
225 dgbmatrix newmat( matA.
m, matB.
n, std::min(matA.
kl+matB.
kl,matA.
m-1), std::min(matA.
ku+matB.
ku,matB.
n-1) );
228 for(CPPL_INT
i=0;
i<newmat.
m;
i++){
229 const CPPL_INT jmax =std::min(newmat.n,
i+newmat.ku+1);
230 for(CPPL_INT j=std::max(CPPL_INT(0),
i-newmat.kl); j<jmax; j++){
231 const CPPL_INT kmax =std::min( std::min(matA.
n,
i+matA.
ku+1), std::min(matB.
m,j+matB.
kl+1) );
232 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++){
233 newmat(
i,j)+= matA(
i,k)*matB(k,j);
CPPL_INT m
matrix row size
CPPL_INT ku
upper band width
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT kl
lower band width
CPPL_INT kl
lower band width
CPPL_INT ku
upper band width
CPPL_INT n
matrix column size
CPPL_INT m
matrix row size
Real Double-precision General Band Matrix Class.
CPPL_INT n
matrix column size
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size