Go to the source code of this file.
dgsmatrix+dgsmatrix operator
Definition at line 91 of file dgsmatrix-dgsmatrix.hpp.
References _(), dgsmatrix::data, dgsmatrix::m, and dgsmatrix::n.
94 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
96 std::cerr <<
"These two matrises can not make a summation." << std::endl
97 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") + (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
104 const std::vector<dcomponent>::const_iterator matB_data_end =matB.
data.end();
105 for(std::vector<dcomponent>::const_iterator it=matB.
data.begin(); it!=matB_data_end; it++){
106 newmat(it->i, it->j) +=it->v;
Real Double-precision General Sparse Matrix Class.
std::vector< dcomponent > data
matrix data
CPPL_INT n
matrix column size
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size
dgsmatrix-dgsmatrix operator
Definition at line 114 of file dgsmatrix-dgsmatrix.hpp.
References _(), dgsmatrix::data, dgsmatrix::m, and dgsmatrix::n.
115 {CPPL_VERBOSE_REPORT;
117 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
119 std::cerr <<
"These two matrises can not make a subtraction." << std::endl
120 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") - (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
127 const std::vector<dcomponent>::const_iterator matB_data_end =matB.
data.end();
128 for(std::vector<dcomponent>::const_iterator it=matB.
data.begin(); it!=matB_data_end; it++){
129 newmat(it->i, it->j) -=it->v;
Real Double-precision General Sparse Matrix Class.
std::vector< dcomponent > data
matrix data
CPPL_INT n
matrix column size
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size
dgsmatrix*dgsmatrix operator
Definition at line 137 of file dgsmatrix-dgsmatrix.hpp.
References _(), dgsmatrix::data, dgsmatrix::m, dgsmatrix::n, and dgsmatrix::rows.
138 {CPPL_VERBOSE_REPORT;
142 std::cerr <<
"These two matrises can not make a product." << std::endl
143 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") * (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
150 const std::vector<dcomponent>::const_iterator matA_data_end =matA.
data.end();
151 for(std::vector<dcomponent>::const_iterator it=matA.
data.begin(); it!=matA_data_end; it++){
153 const std::vector<CPPL_INT>::const_iterator matB_rows_k_end =matB.
rows[k].end();
154 for(std::vector<CPPL_INT>::const_iterator p=matB.
rows[k].begin(); p!=matB_rows_k_end; p++){
155 newmat(it->i,matB.
data[*p].j) +=it->v*matB.
data[*p].v;
Real Double-precision General Sparse Matrix Class.
std::vector< dcomponent > data
matrix data
CPPL_INT n
matrix column size
_dcovector _(dcovector &vec)
std::vector< std::vector< CPPL_INT > > rows
array of vector to store the entry information of component for each row
CPPL_INT m
matrix row size