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;
30 if(matA.
m!=matB.
n || matA.
n!=matB.
n){
32 std::cerr <<
"These two matrises can not make a subtraction." << std::endl
33 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") - (" << matB.
n <<
"x" << matB.
n <<
")." << std::endl;
39 zgematrix newmat( (-matB).to_zgematrix() );
42 const std::vector<zcomponent>::const_iterator matA_data_end =matA.
data.end();
43 for(std::vector<zcomponent>::const_iterator it=matA.
data.begin(); it!=matA_data_end; it++){
44 newmat(it->i,it->j) += it->v;
59 std::cerr <<
"These two matrises can not make a product." << std::endl
60 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") * (" << matB.
n <<
"x" << matB.
n <<
")." << std::endl;
68 const std::vector<zcomponent>::const_iterator matA_data_end =matA.
data.end();
69 for(std::vector<zcomponent>::const_iterator it=matA.
data.begin(); it!=matA_data_end; it++){
70 for(CPPL_INT
i=0;
i<matB.
n;
i++){
71 newmat(it->i,
i) += it->v*matB(it->j,
i);
_dgematrix i(const _dgbmatrix &mat)
_zgematrix operator-(const _zgsmatrix &matA, const zhematrix &matB)
CPPL_INT n
matrix column size
(DO NOT USE) Smart-temporary Real Double-precision General Sparse Matrix Class
Complex Double-precision General Dence Matrix Class.
_zgematrix operator*(const _zgsmatrix &matA, const zhematrix &matB)
_zgematrix to_zgematrix() const
CPPL_INT n
matrix column size
(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
Complex Double-precision Hermitian Matrix Class [l-type (UPLO=l) Strage].
_dcovector _(dcovector &vec)
std::vector< zcomponent > data
matrix data