20 if(
n!=mat.
n ||
m!=mat.
m){
22 std::cerr <<
"These two matrises can not make a summation." << std::endl
23 <<
"Your input was (" <<
m <<
"x" <<
n <<
") += (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
28 const std::vector<zcomponent>::const_iterator mat_data_end =mat.
data.end();
29 for(std::vector<zcomponent>::const_iterator it=mat.
data.begin(); it!=mat_data_end; it++){
30 (*this)(it->i,it->j) +=it->v;
41 if(
n!=mat.
n ||
m!=mat.
m){
43 std::cerr <<
"These two matrises can not make a sutraction." << std::endl
44 <<
"Your input was (" <<
m <<
"x" <<
n <<
") -= (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
49 const std::vector<zcomponent>::const_iterator mat_data_end =mat.
data.end();
50 for(std::vector<zcomponent>::const_iterator it=mat.
data.begin(); it!=mat_data_end; it++){
51 (*this)(it->i,it->j) -=it->v;
64 std::cerr <<
"These two matrises can not make a product." << std::endl
65 <<
"Your input was (" <<
m <<
"x" <<
n <<
") *= (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
72 const std::vector<zcomponent>::const_iterator data_end =
data.end();
73 for(std::vector<zcomponent>::const_iterator it=
data.begin(); it!=data_end; it++){
75 const std::vector<CPPL_INT>::const_iterator mat_rows_k_end =mat.
rows[k].end();
76 for(std::vector<CPPL_INT>::const_iterator p=mat.
rows[k].begin(); p!=mat_rows_k_end; p++){
77 newmat(it->i,mat.
data[*p].j) +=it->v*mat.
data[*p].v;
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<zcomponent>::const_iterator matB_data_end =matB.
data.end();
105 for(std::vector<zcomponent>::const_iterator it=matB.
data.begin(); it!=matB_data_end; it++){
106 newmat(it->i, it->j) +=it->v;
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<zcomponent>::const_iterator matB_data_end =matB.
data.end();
128 for(std::vector<zcomponent>::const_iterator it=matB.
data.begin(); it!=matB_data_end; it++){
129 newmat(it->i, it->j) -=it->v;
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<zcomponent>::const_iterator matA_data_end =matA.
data.end();
151 for(std::vector<zcomponent>::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;
Complex Double-precision General Sparse Matrix Class.
zgsmatrix & operator=(const zgsmatrix &)
zgsmatrix & operator+=(const zgsmatrix &)
(DO NOT USE) Smart-temporary Real Double-precision General Sparse Matrix Class
void copy(const zgsmatrix &)
zgsmatrix & operator-=(const zgsmatrix &)
std::vector< std::vector< CPPL_INT > > rows
array of vector to store the entry information of component for each row
std::vector< zcomponent > data
matrix data
friend void swap(zgsmatrix &, zgsmatrix &)
_zgsmatrix operator+(const zgsmatrix &matA, const zgsmatrix &matB)
zgsmatrix & operator*=(const zgsmatrix &)
_zgsmatrix operator-(const zgsmatrix &matA, const zgsmatrix &matB)
_zgsmatrix operator*(const zgsmatrix &matA, const zgsmatrix &matB)
CPPL_INT m
matrix row size
CPPL_INT n
matrix column size
_dcovector _(dcovector &vec)