6 std::cerr <<
"# [MARK] zgbmatrix::clear()"
11 std::cerr <<
"# [NOTE] zgbmatrix::clear() "
12 <<
" An array at " <<
Array
13 <<
" is going to be cleared." << std::endl;
32 std::cerr <<
"# [MARK] zgbmatrix::zero()"
36 for(
long i=0;
i<(KL+KU+1)*N;
i++){
Array[
i] =std::complex<double>(0.0,0.0); }
44 std::cerr <<
"# [MARK] zgbmatrix::identity()"
50 std::cerr <<
"[ERROR] zgbmatrix::identity()" << std::endl
51 <<
"Only square matrix can be a identity matrix." << std::endl
52 <<
"The matrix size was " << M <<
"x" << N <<
"." << std::endl;
57 for(
long i=0;
i<(KL+KU+1)*N;
i++){
Array[
i] =std::complex<double>(0.0,0.0); }
58 for(
long i=0;
i<M;
i++){
operator()(
i,
i) =std::complex<double>(1.0,0.0); }
66 std::cerr <<
"# [MARK] zgbmatrix::chsign()"
77 std::cerr <<
"# [MARK] zgbmatrix::copy(const zgbmatrix&)"
82 std::cerr <<
"# [NOTE] zgbmatrix::copy(const zgbmatrix&) "
83 <<
"A zgbmatrix at " <<
Array <<
" is going to be deleted. ";
91 Array =
new std::complex<double>[(mat.KL+mat.KU+1)*mat.N];
93 Darray =
new std::complex<double>*[N];
94 for(
int i=0;
i<N;
i++){ Darray[
i] =&Array[
i*(KL+KU+1)]; }
96 zcopy_((mat.KL+mat.KU+1)*mat.N, mat.Array, 1, Array, 1);
99 std::cerr <<
"Then, a COPY of a zgbmatrix has been cleated at "
100 << Array <<
"." << std::endl;
110 std::cerr <<
"# [MARK] zgbmatrix::shallow_copy(const _zgbmatrix&)"
115 std::cerr <<
"# [NOTE] zgbmatrix::shallow_copy(const zgbmatrix&) "
116 <<
"A zgbmatrix at " <<
Array <<
" is going to be deleted "
117 <<
"and point at " << mat.
Array <<
" instead." << std::endl;
133 const long& _kl,
const long& _ku)
136 std::cerr <<
"# [MARK] zgbmatrix::resize(const long&, const long&, const long&, const long&)"
141 if( _m<0 || _n<0 || _kl<0 || _ku<0 || _m<_kl || _n<_ku ){
142 std::cerr <<
"[ERROR] zgbmatrix::resize"
143 <<
"(const long&, const long&, const long&, const long&)"
145 <<
"It is impossible to make a matrix you ordered. "
147 <<
"Your input was ("
148 << _m <<
"," << _n <<
","<< _ku <<
"," << _kl <<
")."
159 Array =
new std::complex<double>[(KL+KU+1)*N];
161 Darray =
new std::complex<double>*[N];
162 for(
int i=0;
i<N;
i++){ Darray[
i] =&
Array[
i*(KL+KU+1)]; }
170 std::cerr <<
"# [MARK] swap(zgbmatrix&, zgbmatrix&)"
174 long A_m(A.M), A_n(A.N), A_kl(A.KL), A_ku(A.KU);
175 std::complex<double>* A_array(A.Array);
176 std::complex<double>** A_darray = A.Darray;
177 A.M=B.M; A.N=B.N; A.KL=B.KL; A.KU=B.KU; A.Array=B.Array; A.Darray=B.Darray;
178 B.M=A_m; B.N=A_n; B.KL=A_kl; B.KU=A_ku; B.Array=A_array; B.Darray=A_darray;
186 std::cerr <<
"# [MARK] _(zgbmatrix&)"
196 newmat.
Array =mat.Array;
197 newmat.
Darray =mat.Darray;
std::complex< double > & operator()(const long &, const long &)
Definition: zgbmatrix-io.hpp:3
std::complex< double > * Array
1D Array to store matrix data
Definition: _zgbmatrix.hpp:11
friend _zgematrix i(const zgbmatrix &)
Definition: zgbmatrix-calc.hpp:22
void clear()
Definition: zgbmatrix-misc.hpp:3
long N
matrix column size
Definition: _zgbmatrix.hpp:8
void copy(const zgbmatrix &)
Definition: zgbmatrix-misc.hpp:74
long KU
upper band width
Definition: _zgbmatrix.hpp:10
void resize(const long &, const long &, const long &, const long &)
Definition: zgbmatrix-misc.hpp:132
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
long M
matrix row size
Definition: _zgbmatrix.hpp:7
void chsign()
Definition: zgbmatrix-misc.hpp:63
(DO NOT USE) Smart-temporary Complex Double-precision General Band Matrix Class
Definition: _zgbmatrix.hpp:3
void identity()
Definition: zgbmatrix-misc.hpp:41
void zero()
Definition: zgbmatrix-misc.hpp:29
std::complex< double > ** Darray
array of pointers of column head addresses
Definition: _zgbmatrix.hpp:12
long KL
lower band width
Definition: _zgbmatrix.hpp:9
std::complex< double > * Array
1D Array to store vector data
Definition: _zrovector.hpp:8
void shallow_copy(const _zgbmatrix &)
Definition: zgbmatrix-misc.hpp:107