6 if(matA.
m!=matB.
n || 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.
n <<
"x" << matB.
n <<
")." << std::endl;
16 const std::vector<zcomponent>::const_iterator matA_data_end =matA.
data.end();
17 for(std::vector<zcomponent>::const_iterator it=matA.
data.begin(); it!=matA_data_end; it++){
18 newmat(it->i,it->j) += it->v;
31 if(matA.
m!=matB.
n || matA.
n!=matB.
n){
33 std::cerr <<
"These two matrises can not make a subtraction." << std::endl
34 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") - (" << matB.
n <<
"x" << matB.
n <<
")." << std::endl;
40 zgematrix newmat( (-matB).to_zgematrix() );
43 const std::vector<zcomponent>::const_iterator matA_data_end =matA.
data.end();
44 for(std::vector<zcomponent>::const_iterator it=matA.
data.begin(); it!=matA_data_end; it++){
45 newmat(it->i,it->j) += it->v;
61 std::cerr <<
"These two matrises can not make a product." << std::endl
62 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") * (" << matB.
n <<
"x" << matB.
n <<
")." << std::endl;
70 const std::vector<zcomponent>::const_iterator matA_data_end =matA.
data.end();
71 for(std::vector<zcomponent>::const_iterator it=matA.
data.begin(); it!=matA_data_end; it++){
72 for(CPPL_INT
i=0;
i<matB.
n;
i++){
73 newmat(it->i,
i) += it->v*matB(it->j,
i);
(DO NOT USE) Smart-temporary Complex Double-precision Hermitian Matrix Class
CPPL_INT n
matrix column size
_zgematrix operator*(const _zgsmatrix &matA, const _zhematrix &matB)
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
(DO NOT USE) Smart-temporary Real Double-precision General Sparse Matrix Class
_zgematrix operator+(const _zgsmatrix &matA, const _zhematrix &matB)
Complex Double-precision General Dence Matrix Class.
(DO NOT USE) Smart-temporary Complex Double-precision General Dence Matrix Class
_zgematrix operator-(const _zgsmatrix &matA, const _zhematrix &matB)
CPPL_INT m
matrix row size
_zgematrix to_zgematrix() const
_dcovector _(dcovector &vec)
std::vector< zcomponent > data
matrix data