6 if( i<0 || j<0 ||
n<=i ||
n<=j ){
8 std::cerr <<
"The required component is out of the matrix size." << std::endl
9 <<
"Your input is (" << i <<
"," << j <<
"), whereas the matrix size is " <<
n <<
"x" <<
n <<
"." << std::endl;
23 if( i<0 || j<0 ||
n<=i ||
n<=j ){
25 std::cerr <<
"The required component is out of the matrix size." << std::endl
26 <<
"Your input is (" << i <<
"," << j <<
"), whereas the matrix size is " <<
n <<
"x" <<
n <<
"." << std::endl;
31 if(i>=j){
return darray[j][
i]; }
44 if( i<0 || j<0 ||
n<=i ||
n<=j ){
46 std::cerr <<
"The required component is out of the matrix size." << std::endl
47 <<
"Your input is (" << i <<
"," << j <<
"), whereas the matrix size is " <<
n <<
"x" <<
n <<
"." << std::endl;
67 for(CPPL_INT
i=0;
i<mat.
n;
i++){
68 for(CPPL_INT j=0; j<mat.
n; j++){
69 if(
i>j){ s <<
" " << mat(
i,j) <<
" "; }
70 else if(
i==j){ s <<
" " << std::real(mat(
i,
i)) <<
" "; }
71 else{ s <<
"{" <<
std::conj(mat(j,
i)) <<
"} "; }
78 std::cerr <<
"The " <<
i <<
"th diagonal component of the zhematrix is not a real number." << std::endl;
93 std::ofstream ofs(filename, std::ios::trunc);
94 ofs.setf(std::cout.flags());
95 ofs.precision(std::cout.precision());
96 ofs.width(std::cout.width());
97 ofs.fill(std::cout.fill());
99 ofs <<
"#zhematrix " <<
n << std::endl;
100 for(CPPL_INT
i=0;
i<
n;
i++){
101 for(CPPL_INT j=0; j<=
i; j++ ){
107 if(std::fabs(
std::imag(
operator()(
i,
i))) > DBL_MIN){
109 std::cerr <<
"The " <<
i <<
"th diagonal component of the zhematrix is not a real number." << std::endl;
119 {CPPL_VERBOSE_REPORT;
120 std::ifstream s(filename);
123 std::cerr <<
"The file \"" << filename <<
"\" can not be opened." << std::endl;
129 if(
id !=
"zhematrix" &&
id !=
"#zhematrix" ){
131 std::cerr <<
"The type name of the file \"" << filename <<
"\" is not zhematrix." << std::endl
132 <<
"Its type name was " <<
id <<
" ." << std::endl;
138 for(CPPL_INT
i=0;
i<
n;
i++){
139 for(CPPL_INT j=0; j<=
i; j++ ){
146 std::cerr <<
"There is something is wrong with the file \"" << filename <<
"\"." << std::endl
147 <<
"Most likely, there is not enough data components, or a linefeed code or space code is missing at the end of the last line." << std::endl;
154 std::cerr <<
"There is something is wrong with the file \"" << filename <<
"\"." << std::endl
155 <<
"Most likely, there are extra data components." << std::endl;
zhecomplex operator()(const CPPL_INT &, const CPPL_INT &)
std::ostream & operator<<(std::ostream &s, const zhematrix &mat)
zhematrix & set(const CPPL_INT &, const CPPL_INT &, const comple &)
_dgematrix i(const _dgbmatrix &mat)
_zcovector conj(const _zcovector &vec)
CPPL_INT n
matrix column size
friend _zgematrix i(const zhematrix &)
(DO NOT USE) Complex-double Class for Hermitian matrices
dcovec3 imag(const dquater &q)
void resize(const CPPL_INT &)
Complex Double-precision Hermitian Matrix Class [l-type (UPLO=l) Strage].
comple ** darray
array of pointers of column head addresses
void write(const char *) const