6 std::cerr <<
"# [MARK] _zhematrix::operator()(const long&, const long&) const"
11 if( i<0 || j<0 ||
N<=i ||
N<=j ){
12 std::cerr <<
"[ERROR] _zhematrix::operator()(long, long) const"
14 <<
"The required component is out of the matrix size."
16 <<
"Your input was (" << i <<
"," << j <<
")." << std::endl;
32 inline std::ostream& operator<<(std::ostream& s,
const _zhematrix& mat)
35 std::cerr <<
"# [MARK] operator<<(std::ostream&, const _zhematrix&)"
39 for(
long i=0; i<mat.
N; i++){
40 for(
long j=0; j<mat.
N; j++){
41 if(i>j){ s <<
" " << mat(i,j) <<
" "; }
42 else if(i==j){ s <<
" " << std::real(mat(i,i)) <<
" "; }
43 else{ s <<
"{" << std::conj(mat(j,i)) <<
"} "; }
48 if(std::fabs(std::imag(mat(i,i))) > CPPL_EPS){
49 std::cerr <<
"[WARNING] operator<<(std::ostream&, const _zhematrix&)"
51 <<
"The " << i <<
"th diagonal component of the zhematrix"
52 <<
"is not a real number." << std::endl;
66 inline void _zhematrix::write(
const char* filename)
const
69 std::cerr <<
"# [MARK] _zhematrix::write(const char*) const"
73 std::ofstream s(filename, std::ios::trunc);
75 s <<
"zhematrix" <<
" " <<
N << std::endl;
76 for(
long i=0;
i<
N;
i++){
77 for(
long j=0; j<=
i; j++ ){
83 if(std::fabs(std::imag(
operator()(
i,
i))) > CPPL_EPS){
84 std::cerr <<
"[WARNING] _zhematrix::write(const char*)" << std::endl
85 <<
"The " <<
i <<
"th diagonal component of the zhematrix"
86 <<
"is not a real number." << std::endl;
(DO NOT USE) Smart-temporary Complex Double-precision Hermitian Matrix Class
Definition: _zhematrix.hpp:3
std::complex< double > ** Darray
array of pointers of column head addresses
Definition: _zhematrix.hpp:9
void destroy() const
Definition: _zhematrix-misc.hpp:3
long N
matrix column or row size
Definition: _zhematrix.hpp:7
__zhecomplex operator()(const long &, const long &) const
Definition: _zhematrix-io.hpp:3
friend _zgematrix i(const _zhematrix &)
Definition: _zhematrix-calc.hpp:21
(DO NOT USE) Shaddow Complex-double Class for zhematrix
Definition: __zhecomplex.hpp:3