7 for(CPPL_INT
i=0;
i<n;
i++){
8 for(CPPL_INT j=0; j<=
i; j++){ newmat(
i,j) =(*this)(
i,j); }
9 for(CPPL_INT j=
i+1; j<n; j++){ newmat(
i,j) =(*this)(j,
i); }
20 for(CPPL_INT
i=0;
i<n;
i++){
21 for(CPPL_INT j=0; j<=
i; j++){
22 newmat(
i,j) =(*this)(
i,j);
43 std::cerr <<
"i must be greater than or equal to j since dsymatrix_small is L strage. " << std::endl;
44 std::cerr <<
"Your input was (" << i <<
", " << j <<
")." << std::endl;
50 return array[(i*(i+1))/2 +j];
61 std::cerr <<
"i must be greater than or equal to j since dsymatrix_small is L strage. " << std::endl;
62 std::cerr <<
"Your input was (" << i <<
", " << j <<
")." << std::endl;
68 return array[(i*(i+1))/2 +j];
83 inline std::ostream& operator<<(std::ostream& s, const zhematrix_small<n>& A)
85 s << std::setiosflags(std::ios::showpos);
86 for(CPPL_INT
i=0;
i<n;
i++){
87 for(CPPL_INT j=0; j<=
i; j++){ s <<
" " << A(
i,j) <<
" "<< std::flush; }
88 for(CPPL_INT j=
i+1; j<n; j++){ s <<
"{" << A(j,
i) <<
"}" << std::flush; }
99 std::ofstream ofs(filename, std::ios::trunc);
100 ofs.setf(std::cout.flags());
101 ofs.precision(std::cout.precision());
102 ofs.width(std::cout.width());
103 ofs.fill(std::cout.fill());
104 ofs <<
"#zhematrix" <<
" " << n << std::endl;
105 for(CPPL_INT
i=0;
i<n;
i++){
106 for(CPPL_INT j=0; j<=
i; j++){
107 ofs << (*this)(
i,j) <<
" ";
118 {CPPL_VERBOSE_REPORT;
119 std::ifstream s(filename);
122 std::cerr <<
"The file \"" << filename <<
"\" can not be opened." << std::endl;
128 if(
id !=
"zhematrix" &&
id !=
"#zhematrix" ){
130 std::cerr <<
"The type name of the file \"" << filename <<
"\" is not zhematrix." << std::endl
131 <<
"Its type name was " <<
id <<
" ." << std::endl;
139 std::cerr <<
"Matrix size is invalid." << std::endl;
143 for(CPPL_INT
i=0;
i<n;
i++){
144 for(CPPL_INT j=0; j<=
i; j++ ){
145 s >> operator()(
i,j);
150 std::cerr <<
"There is something is wrong with the file \"" << filename <<
"\"." << std::endl
151 <<
"Most likely, there is a lack of data components, or a linefeed code or space code is missing at the end of the last line." << std::endl;
169 {CPPL_VERBOSE_REPORT;
170 for(CPPL_INT
i=0;
i<n;
i++){
171 for(CPPL_INT j=0; j<=
i; j++){
182 {CPPL_VERBOSE_REPORT;
184 for(CPPL_INT k=0; k<n; k++){
194 {CPPL_VERBOSE_REPORT;
195 comple
trace =comple(0.,0.);
196 for(CPPL_INT
i=0;
i<n;
i++){
206 {CPPL_VERBOSE_REPORT;
208 for(CPPL_INT
i=0;
i<n;
i++){
209 for(CPPL_INT j=0; j<=
i; j++){
210 if( max<fabs(A(
i,j)) ){
224 {CPPL_VERBOSE_REPORT;
241 {CPPL_VERBOSE_REPORT;
242 for(CPPL_INT k=0; k<(n*(n+1))/2; k++){
252 {CPPL_VERBOSE_REPORT;
253 for(CPPL_INT k=0; k<(n*(n+1))/2; k++){
263 {CPPL_VERBOSE_REPORT;
264 for(CPPL_INT
i=0;
i<n;
i++){
265 for(CPPL_INT j=0; j<=
i; j++){
276 {CPPL_VERBOSE_REPORT;
277 for(CPPL_INT
i=0;
i<n;
i++){
278 for(CPPL_INT j=0; j<=
i; j++){
289 {CPPL_VERBOSE_REPORT;
290 for(CPPL_INT
i=0;
i<n;
i++){
291 for(CPPL_INT j=0; j<=
i; j++){
302 {CPPL_VERBOSE_REPORT;
303 for(CPPL_INT
i=0;
i<n;
i++){
304 for(CPPL_INT j=0; j<=
i; j++){
319 {CPPL_VERBOSE_REPORT;
327 {CPPL_VERBOSE_REPORT;
329 for(CPPL_INT
i=0;
i<n;
i++){
330 for(CPPL_INT j=0; j<=
i; j++){
345 {CPPL_VERBOSE_REPORT;
347 for(CPPL_INT
i=0;
i<n;
i++){
348 for(CPPL_INT j=0; j<
i; j++){
349 X(i,j) =A(i,j)+B(i,j);
351 for(CPPL_INT j=i; j<n; j++){
352 X(i,j) =A(j,i)+B(i,j);
362 {CPPL_VERBOSE_REPORT;
364 for(CPPL_INT
i=0;
i<n;
i++){
365 for(CPPL_INT j=0; j<=
i; j++){
366 X(
i,j) =A(
i,j)+B(
i,j);
380 {CPPL_VERBOSE_REPORT;
382 for(CPPL_INT
i=0;
i<n;
i++){
383 for(CPPL_INT j=0; j<
i; j++){
384 X(i,j) =A(i,j)-B(i,j);
386 for(CPPL_INT j=i; j<n; j++){
387 X(i,j) =A(j,i)-B(i,j);
397 {CPPL_VERBOSE_REPORT;
399 for(CPPL_INT
i=0;
i<n;
i++){
400 for(CPPL_INT j=0; j<=
i; j++){
401 X(
i,j) =A(
i,j)-B(
i,j);
415 {CPPL_VERBOSE_REPORT;
418 for(CPPL_INT
i=0;
i<n;
i++){
419 for(CPPL_INT j=0; j<
i; j++){
422 for(CPPL_INT j=i; j<n; j++){
431 template<CPPL_INT m, CPPL_INT n>
433 {CPPL_VERBOSE_REPORT;
436 for(CPPL_INT
i=0;
i<m;
i++){
437 for(CPPL_INT j=0; j<n; j++){
438 for(CPPL_INT k=0; k<
i; k++){
439 X(i,j) +=A(i,k)*B(k,j);
441 for(CPPL_INT k=i; k<m; k++){
442 X(i,j) +=A(k,i)*B(k,j);
453 {CPPL_VERBOSE_REPORT;
456 for(CPPL_INT
i=0;
i<n;
i++){
457 for(CPPL_INT j=0; j<
i; j++){
458 for(CPPL_INT k=0; k<j; k++){
459 X(i,j) +=A(i,k)*B(j,k);
461 for(CPPL_INT k=j; k<
i; k++){
462 X(i,j) +=A(i,k)*B(k,j);
464 for(CPPL_INT k=i; k<n; k++){
465 X(i,j) +=A(k,i)*B(k,j);
468 for(CPPL_INT j=i; j<n; j++){
469 for(CPPL_INT k=0; k<
i; k++){
470 X(i,j) +=A(i,k)*B(j,k);
472 for(CPPL_INT k=i; k<j; k++){
473 X(i,j) +=A(k,i)*B(j,k);
475 for(CPPL_INT k=j; k<n; k++){
476 X(i,j) +=A(k,i)*B(k,j);
487 {CPPL_VERBOSE_REPORT;
489 for(CPPL_INT
i=0;
i<n;
i++){
490 for(CPPL_INT j=0; j<=
i; j++){
501 {CPPL_VERBOSE_REPORT;
503 for(CPPL_INT
i=0;
i<n;
i++){
504 for(CPPL_INT j=0; j<=
i; j++){
519 {CPPL_VERBOSE_REPORT;
521 for(CPPL_INT
i=0;
i<n;
i++){
522 for(CPPL_INT j=0; j<=
i; j++){
533 {CPPL_VERBOSE_REPORT;
535 for(CPPL_INT
i=0;
i<n;
i++){
536 for(CPPL_INT j=0; j<=
i; j++){
551 {CPPL_VERBOSE_REPORT;
553 for(CPPL_INT
i=0;
i<n;
i++){
554 for(CPPL_INT j=0; j<=
i; j++){
555 C(
i,j) =A(
i,j)*B(
i,j);
557 for(CPPL_INT j=
i+1; j<n; j++){
568 {CPPL_VERBOSE_REPORT;
570 for(CPPL_INT
i=0;
i<n;
i++){
571 for(CPPL_INT j=0; j<=
i; j++){
572 C(
i,j) =A(
i,j)*B(
i,j);
comple & operator()(const CPPL_INT &i, const CPPL_INT &j)
comple array[(n *(n+1))/2]
zgematrix_small< n, n > hadamard(const zhematrix_small< n > &A, const zgematrix_small< n, n > &B)
void read(const char *filename)
comple damax(const zhematrix_small< n > &A)
zgematrix_small< n, n > to_zgematrix_small() const
_dgematrix i(const _dgbmatrix &mat)
zhematrix_small< n > operator-(const zhematrix_small< n > &A)
Samll Complex Double-precision Column Vector Class.
_zcovector conj(const _zcovector &vec)
zcovector_small< l > & zero()
zhematrix_small< n > & set(const CPPL_INT &, const CPPL_INT &, const comple &)
zhematrix_small< n > & identity()
zhematrix_small< n > & operator+=(zhematrix_small< n > &A, const zhematrix_small< n > &B)
zgematrix_small< m, n > & zero()
comple trace(const zhematrix_small< n > &A)
const zhematrix_small< n > & operator+(const zhematrix_small< n > &A)
zhematrix_small< n > & operator*=(zhematrix_small< n > &A, const double &v)
zcovector_small< n > operator*(const zhematrix_small< n > &A, const zcovector_small< n > &B)
zhematrix_small< n > & operator/=(zhematrix_small< n > &A, const double &v)
Complex Double-precision Hermitian Matrix Class [l-type (UPLO=l) Strage].
zhematrix_small< n > & zero()
void write(const char *filename) const
Samll Complex Double-precision General Dence Matrix Class.
void idamax(CPPL_INT &I, CPPL_INT &J, const zhematrix_small< n > &A)
Samll Complex Double-precision Symmetric Matrix Class.
zhematrix to_zhematrix() const
zhematrix_small< n > operator/(const zhematrix_small< n > &A, const double &v)
zhematrix_small< n > & operator-=(zhematrix_small< n > &A, const zhematrix_small< n > &B)