6 std::cerr <<
"# [MARK] zgematrix::clear()"
11 std::cerr <<
"# [NOTE] zgematrix::clear() "
12 <<
" An array at " <<
Array
13 <<
" is going to be cleared." << std::endl;
29 std::cerr <<
"# [MARK] zgematrix::zero()"
33 for(
long i=0;
i<M*N;
i++){
Array[
i] =std::complex<double>(0.0,0.0); }
41 std::cerr <<
"# [MARK] zgematrix::identity()"
47 std::cerr <<
"[ERROR] zgematrix::identity()" << std::endl
48 <<
"Only square matrix can be a identity matrix." << std::endl
49 <<
"The matrix size was " << M <<
"x" << N <<
"." << std::endl;
54 for(
long i=0;
i<M*N;
i++){
Array[
i] =std::complex<double>(0.0,0.0); }
55 for(
long i=0;
i<M;
i++){
operator()(
i,
i) =std::complex<double>(1.0,0.0); }
63 std::cerr <<
"# [MARK] zgematrix::chsign()"
75 std::cerr <<
"# [MARK] zgematrix::copy(const zgematrix&)"
80 std::cerr <<
"# [NOTE] zgematrix::copy(const zgematrix&) "
81 <<
"A zgematrix at " <<
Array <<
" is going to be deleted.";
87 Array =
new std::complex<double>[M*N];
89 Darray =
new std::complex<double>*[N];
90 for(
int i=0;
i<N;
i++){ Darray[
i] =&Array[
i*M]; }
92 zcopy_(mat.M*mat.N, mat.Array, 1, Array, 1);
95 std::cerr <<
" Then, a COPY of a zgematrix has been cleated at "
96 << Array <<
"." << std::endl;
106 std::cerr <<
"# [MARK] zgematrix::shallow_copy(const _zgematrix&)"
111 std::cerr <<
"# [NOTE] zgematrix:shallow_copy(const _zgematrix&) "
112 <<
"A zgematrix at " <<
Array <<
" is going to be deleted, "
113 <<
"and point at " << mat.
Array <<
" instead." << std::endl;
129 std::cerr <<
"# [MARK] zgematrix::resize(const long&, const long&)"
135 std::cerr <<
"[ERROR] zgematrix::resize(const long&, const long&)"
137 <<
"Matrix sizes must be positive integers." << std::endl
138 <<
"Your input was (" << _m <<
"," << _n <<
")." << std::endl;
146 Array =
new std::complex<double>[M*N];
148 Darray =
new std::complex<double>*[N];
149 for(
int i=0;
i<N;
i++){ Darray[
i] =&
Array[
i*M]; }
157 std::cerr <<
"# [MARK] swap(zgematrix&, zgematrix&)"
161 long A_m(A.M), A_n(A.N);
162 std::complex<double>* A_array(A.Array);
163 std::complex<double>** A_darray = A.Darray;
164 A.M=B.M; A.N=B.N; A.Array=B.Array; A.Darray=B.Darray;
165 B.M=A_m; B.N=A_n; B.Array=A_array; B.Darray=A_darray;
173 std::cerr <<
"# [MARK] _(zgematrix&)"
181 newmat.
Array =mat.Array;
182 newmat.
Darray =mat.Darray;
void resize(const long &, const long &)
Definition: zgematrix-misc.hpp:126
void shallow_copy(const _zgematrix &)
Definition: zgematrix-misc.hpp:103
void identity()
Definition: zgematrix-misc.hpp:38
long N
matrix column size
Definition: _zgematrix.hpp:8
void copy(const zgematrix &)
Definition: zgematrix-misc.hpp:72
std::complex< double > * Array
1D Array to store matrix data
Definition: _zgematrix.hpp:9
std::complex< double > ** Darray
array of pointers of column head addresses
Definition: _zgematrix.hpp:10
friend _zgematrix i(const zgematrix &)
Definition: zgematrix-calc.hpp:21
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
void chsign()
Definition: zgematrix-misc.hpp:60
(DO NOT USE) Smart-temporary Complex Double-precision General Dence Matrix Class
Definition: _zgematrix.hpp:3
void clear()
Definition: zgematrix-misc.hpp:3
void zero()
Definition: zgematrix-misc.hpp:26
std::complex< double > & operator()(const long &, const long &)
Definition: zgematrix-io.hpp:3
std::complex< double > * Array
1D Array to store vector data
Definition: _zrovector.hpp:8
long M
matrix row size
Definition: _zgematrix.hpp:7