6 if(matA.
m!=matB.
m || matA.
n!=matB.
n){
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;
13 const std::vector<dcomponent>::const_iterator matB_data_end =matB.
data.end();
14 for(std::vector<dcomponent>::const_iterator it=matB.
data.begin(); it!=matB_data_end; it++){
15 matA(it->i,it->j) += it->v;
26 if(matA.
m!=matB.
m || matA.
n!=matB.
n){
28 std::cerr <<
"These two matrises can not make a subtraction." << std::endl
29 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") - (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
35 for(CPPL_INT
i=0;
i<matA.
m*matA.
n;
i++){
40 const std::vector<dcomponent>::const_iterator matB_data_end =matB.
data.end();
41 for(std::vector<dcomponent>::const_iterator it=matB.
data.begin(); it!=matB_data_end; it++){
42 matA(it->i,it->j) += it->v;
55 std::cerr <<
"These two matrises can not make a product." << std::endl
56 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") * (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
64 const std::vector<dcomponent>::const_iterator matB_data_end =matB.
data.end();
65 for(std::vector<dcomponent>::const_iterator it=matB.
data.begin(); it!=matB_data_end; it++){
66 for(CPPL_INT
i=0;
i<matA.
m;
i++){
67 newmat(
i,it->j) += matA(
i,it->
i)*it->v;
Real Double-precision General Sparse Matrix Class.
std::vector< dcomponent > data
matrix data
CPPL_INT n
matrix column size
_dgematrix i(const _dgbmatrix &mat)
Real Double-precision General Dence Matrix Class.
friend _dgematrix i(const _dgematrix &)
CPPL_INT m
matrix row size
double * array
1D array to store matrix data
(DO NOT USE) Smart-temporary Real Double-precision General Dence Matrix Class
CPPL_INT n
matrix column size
_dgematrix operator-(const _dgematrix &matA, const dgsmatrix &matB)
_dcovector _(dcovector &vec)
_dgematrix operator+(const _dgematrix &matA, const dgsmatrix &matB)
CPPL_INT m
matrix row size
_dgematrix operator*(const _dgematrix &matA, const dgsmatrix &matB)