6 if(
n!=mat.
n ||
m!=mat.
m){
8 std::cerr <<
"These two matrises can not make a summation." << std::endl
9 <<
"Your input was (" <<
m <<
"x" <<
n <<
") += (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
14 for(CPPL_INT
i=0;
i<mat.
m;
i++){
15 const CPPL_INT jmax =std::min(
n,
i+mat.
ku+1);
16 for(CPPL_INT j=std::max(CPPL_INT(0),
i-mat.
kl); j<jmax; j++){
29 if(
n!=mat.
n ||
m!=mat.
m){
31 std::cerr <<
"These two matrises can not make a subtraction." << std::endl
32 <<
"Your input was (" <<
m <<
"x" <<
n <<
") -= (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
37 for(CPPL_INT
i=0;
i<mat.
m;
i++){
38 const CPPL_INT jmax =std::min(
n,
i+mat.
ku+1);
39 for(CPPL_INT j=std::max(CPPL_INT(0),
i-mat.
kl); j<jmax; j++){
54 std::cerr <<
"These two matrises can not make a product." << std::endl
55 <<
"Your input was (" <<
m <<
"x" <<
n <<
") *= (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
62 for(CPPL_INT
i=0;
i<newmat.
m;
i++){
63 for(CPPL_INT j=0; j<newmat.
n; j++){
64 const CPPL_INT kmax =std::min(mat.
m,j+mat.
kl+1);
65 for(CPPL_INT k=std::max(CPPL_INT(0),j-mat.
ku); k<kmax; k++){
84 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
86 std::cerr <<
"These two matrises can not make a summation." << std::endl
87 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") + (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
94 for(CPPL_INT
i=0;
i<matB.
m;
i++){
95 const CPPL_INT jmax =std::min(matB.
n,
i+matB.
ku+1);
96 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matB.
kl); j<jmax; j++){
97 newmat(
i,j) += matB(
i,j);
107 {CPPL_VERBOSE_REPORT;
109 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
111 std::cerr <<
"These two matrises can not make a summation." << std::endl
112 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") + (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
119 for(CPPL_INT
i=0;
i<matB.
m;
i++){
120 const CPPL_INT jmax =std::min(matB.
n,
i+matB.
ku+1);
121 for(CPPL_INT j=std::max(CPPL_INT(0),
i-matB.
kl); j<jmax; j++){
122 newmat(
i,j) -= matB(
i,j);
132 {CPPL_VERBOSE_REPORT;
136 std::cerr <<
"These two matrises can not make a product." << std::endl
137 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") * (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
145 for(CPPL_INT
i=0;
i<newmat.
m;
i++){
146 for(CPPL_INT j=0; j<newmat.
n; j++){
147 const CPPL_INT kmax =std::min(matB.
m,j+matB.
kl+1);
148 for(CPPL_INT k=std::max(CPPL_INT(0),j-matB.
ku); k<kmax; k++){
149 newmat(
i,j) += matA(
i,k)*matB(k,j);
CPPL_INT m
matrix row size
CPPL_INT m
matrix row size
_dgematrix i(const _dgbmatrix &mat)
friend void swap(dgematrix &, dgematrix &)
double & operator()(const CPPL_INT &, const CPPL_INT &)
CPPL_INT n
matrix column size
Real Double-precision General Dence Matrix Class.
CPPL_INT kl
lower band width
CPPL_INT ku
upper band width
dgematrix & operator*=(const dgematrix &)
(DO NOT USE) Smart-temporary Real Double-precision General Dence Matrix Class
Real Double-precision General Band Matrix Class.
_dgematrix operator+(const dgematrix &matA, const dgbmatrix &matB)
_dgematrix operator*(const dgematrix &matA, const dgbmatrix &matB)
_dgematrix operator-(const dgematrix &matA, const dgbmatrix &matB)
dgematrix & operator-=(const dgematrix &)
friend _dgematrix i(const dgematrix &)
CPPL_INT n
matrix column size
dgematrix & operator+=(const dgematrix &)
_dcovector _(dcovector &vec)