18 if(
n!=mat.
n ||
m!=mat.
m){
20 std::cerr <<
"These two matrises can not make a summation." << std::endl
21 <<
"Your input was (" <<
m <<
"x" <<
n <<
") += (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
26 const std::vector<zcomponent>::const_iterator mat_data_end =mat.
data.end();
27 for(std::vector<zcomponent>::const_iterator it=mat.
data.begin(); it!=mat_data_end; it++){
28 (*this)(it->i,it->j) += it->v;
40 if(
n!=mat.
n ||
m!=mat.
m){
42 std::cerr <<
"These two matrises can not make a sutraction." << std::endl
43 <<
"Your input was (" <<
m <<
"x" <<
n <<
") -= (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
48 const std::vector<zcomponent>::const_iterator mat_data_end =mat.
data.end();
49 for(std::vector<zcomponent>::const_iterator it=mat.
data.begin(); it!=mat_data_end; it++){
50 (*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>::iterator mat_rows_k_end =mat.
rows[k].end();
76 for(std::vector<CPPL_INT>::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;
95 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
97 std::cerr <<
"These two matrises can not make a summation." << std::endl
98 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") + (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
105 const std::vector<zcomponent>::const_iterator matA_data_end =matA.
data.end();
106 for(std::vector<zcomponent>::const_iterator it=matA.
data.begin(); it!=matA_data_end; it++){
107 newmat(it->i,it->j) += it->v;
116 {CPPL_VERBOSE_REPORT;
118 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
120 std::cerr <<
"These two matrises can not make a subtraction." << std::endl
121 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") - (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
129 const std::vector<zcomponent>::const_iterator matA_data_end =matA.
data.end();
130 for(std::vector<zcomponent>::const_iterator it=matA.
data.begin(); it!=matA_data_end; it++){
131 newmat(it->i,it->j) += it->v;
140 {CPPL_VERBOSE_REPORT;
144 std::cerr <<
"These two matrises can not make a product." << std::endl
145 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") * (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
152 const std::vector<zcomponent>::const_iterator matA_data_end =matA.
data.end();
153 for(std::vector<zcomponent>::const_iterator it=matA.
data.begin(); it!=matA_data_end; it++){
155 const std::vector<CPPL_INT>::iterator matB_rows_k_end =matB.
rows[k].end();
156 for(std::vector<CPPL_INT>::iterator p=matB.
rows[k].begin(); p!=matB_rows_k_end; p++){
157 newmat(it->i,matB.
data[*p].j) += it->v*matB.
data[*p].v;
std::vector< std::vector< CPPL_INT > > rows
array of vector to store the entry information of component for each row
Complex Double-precision General Sparse Matrix Class.
zgsmatrix & operator=(const zgsmatrix &)
_zgsmatrix operator*(const zgsmatrix &matA, const _zgsmatrix &matB)
CPPL_INT n
matrix column size
zgsmatrix & operator+=(const zgsmatrix &)
(DO NOT USE) Smart-temporary Real Double-precision General Sparse Matrix Class
void shallow_copy(const _zgsmatrix &)
zgsmatrix & operator-=(const zgsmatrix &)
std::vector< zcomponent > data
matrix data
friend void swap(zgsmatrix &, zgsmatrix &)
CPPL_INT m
matrix row size
zgsmatrix & operator*=(const zgsmatrix &)
_zgsmatrix operator+(const zgsmatrix &matA, const _zgsmatrix &matB)
CPPL_INT m
matrix row size
CPPL_INT n
matrix column size
_dcovector _(dcovector &vec)
_zgsmatrix operator-(const zgsmatrix &matA, const _zgsmatrix &matB)
std::vector< zcomponent > data
matrix data