6 std::cerr <<
"# [MARK] zssmatrix::operator=(const _zssmatrix&)"
23 std::cerr <<
"# [MARK] zssmatrix::operator+=(const _zssmatrix&)"
28 if(N!=mat.
N || M!=mat.
M){
29 std::cerr <<
"[ERROR] zssmatrix::operator+=(const _zssmatrix&)"
31 <<
"These two matrises can not make a summation." << std::endl
32 <<
"Your input was (" << M <<
"x" << N <<
") += ("
33 << mat.
M <<
"x" << mat.
N <<
")." << std::endl;
38 for(
long c=0; c<mat.
VOL; c++){
51 std::cerr <<
"# [MARK] zssmatrix::operator-=(const _zssmatrix&)"
56 if(N!=mat.
N || M!=mat.
M){
57 std::cerr <<
"[ERROR] zssmatrix::operator-=(const _zssmatrix&)"
59 <<
"These two matrises can not make a sutraction." << std::endl
60 <<
"Your input was (" << M <<
"x" << N <<
") -= ("
61 << mat.
M <<
"x" << mat.
N <<
")." << std::endl;
66 for(
long c=0; c<mat.
VOL; c++){
79 std::cerr <<
"# [MARK] zssmatrix::operator*=(const _zssmatrix&)"
85 std::cerr <<
"[ERROR] zssmatrix::operator*=(const _zssmatrix&)"
87 <<
"These two matrises can not make a product." << std::endl
88 <<
"Your input was (" << M <<
"x" << N <<
") *= ("
89 << mat.
M <<
"x" << mat.
N <<
")." << std::endl;
96 for(
long c=0; c<VOL; c++){
97 for(
long d=0; d<mat.
VOL; d++){
98 if(Jndx[c]==mat.
Indx[d]){
118 std::cerr <<
"# [MARK] operator+(const zssmatrix&, const _zssmatrix&)"
123 if(matA.N!=matB.
N || matA.M!=matB.
M){
124 std::cerr <<
"[ERROR] operator+(const zssmatrix&, const _zssmatrix&)"
126 <<
"These two matrises can not make a summation." << std::endl
127 <<
"Your input was (" << matA.M <<
"x" << matA.N <<
") + ("
128 << matB.
M <<
"x" << matB.
N <<
")." << std::endl;
135 for(
long c=0; c<matA.VOL; c++){
136 newmat.add(matA.Indx[c], matA.Jndx[c], matA.Array[c]);
147 std::cerr <<
"# [MARK] operator-(const zssmatrix&, const _zssmatrix&)"
152 if(matA.N!=matB.
N || matA.M!=matB.
M){
153 std::cerr <<
"[ERROR] operator-(const zssmatrix&, const zssmatrix&)"
155 <<
"These two matrises can not make a subtraction." << std::endl
156 <<
"Your input was (" << matA.M <<
"x" << matA.N <<
") - ("
157 << matB.
M <<
"x" << matB.
N <<
")." << std::endl;
166 for(
long c=0; c<matA.VOL; c++){
167 newmat.add(matA.Indx[c], matA.Jndx[c], matA.Array[c]);
178 std::cerr <<
"# [MARK] operator*(const zssmatrix&, const _zssmatrix&)"
184 std::cerr <<
"[ERROR] operator*(const zssmatrix&, const zssmatrix&)"
186 <<
"These two matrises can not make a product." << std::endl
187 <<
"Your input was (" << matA.M <<
"x" << matA.N <<
") * ("
188 << matB.
M <<
"x" << matB.
N <<
")." << std::endl;
195 for(
long c=0; c<matA.VOL; c++){
196 for(
long d=0; d<matB.
VOL; d++){
197 if(matA.Jndx[c]==matB.
Indx[d]){
198 newmat.add(matA.Indx[c], matB.
Jndx[d], matA.Array[c]*matB.
Array[d]);
zssmatrix & operator-=(const zssmatrix &)
Definition: zssmatrix-zssmatrix.hpp:48
long M
matrix row size
Definition: _zssmatrix.hpp:7
long VOL
the number of non-zero components
Definition: _zssmatrix.hpp:10
(DO NOT USE) Smart-temporary Complex Double-precision Sparse Matrix Class
Definition: _zssmatrix.hpp:3
void add(const long &, const long &, const std::complex< double > &)
Definition: zssmatrix-io.hpp:120
zssmatrix & operator*=(const zssmatrix &)
Definition: zssmatrix-zssmatrix.hpp:74
friend _zrovector operator-(const _zrovector &)
Definition: _zrovector-unary.hpp:15
friend void swap(zssmatrix &, zssmatrix &)
Definition: zssmatrix-misc.hpp:228
void shallow_copy(const _zssmatrix &)
Definition: zssmatrix-misc.hpp:77
void sub(const long &, const long &, const std::complex< double > &)
Definition: zssmatrix-io.hpp:157
std::complex< double > * Array
1D array to store non-zero matrix data
Definition: _zssmatrix.hpp:11
void destroy() const
Definition: _zssmatrix-misc.hpp:3
friend _zrovector operator*(const zrovector &, const zgematrix &)
Definition: zrovector-zgematrix.hpp:3
zssmatrix & operator=(const zssmatrix &)
Definition: zssmatrix-zssmatrix.hpp:3
long N
matrix column size
Definition: _zssmatrix.hpp:8
long * Jndx
1D array to store the j-index of non-zero matrix components
Definition: _zssmatrix.hpp:13
Complex Double-precision Sparse Matrix Class.
Definition: zssmatrix.hpp:3
friend const _zrovector & operator+(const _zrovector &)
Definition: _zrovector-unary.hpp:3
zssmatrix & operator+=(const zssmatrix &)
Definition: zssmatrix-zssmatrix.hpp:22
long * Indx
1D array to store the i-index of non-zero matrix components
Definition: _zssmatrix.hpp:12
std::complex< double > * Array
1D Array to store vector data
Definition: _zrovector.hpp:8