CPPLapack
 All Classes Files Functions Variables Friends Pages
Functions
zgematrix_small-functions.hpp File Reference

Go to the source code of this file.

Functions

template<CPPL_INT m, CPPL_INT n>
std::ostream & operator<< (std::ostream &s, const zgematrix_small< m, n > &A)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< n, m > t (const zgematrix_small< m, n > &A)
 
template<CPPL_INT m, CPPL_INT n>
comple trace (const zgematrix_small< m, n > &A)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > & operator+= (zgematrix_small< m, n > &A, const zgematrix_small< m, n > &B)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > & operator-= (zgematrix_small< m, n > &A, const zgematrix_small< m, n > &B)
 
template<CPPL_INT m, CPPL_INT l, CPPL_INT n>
zgematrix_small< m, n > & operator*= (zgematrix_small< m, l > &A, const zgematrix_small< l, n > &B)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > & operator*= (zgematrix_small< m, n > &A, const double &v)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > & operator*= (zgematrix_small< m, n > &A, const comple &v)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > & operator/= (zgematrix_small< m, n > &A, const double &v)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > & operator/= (zgematrix_small< m, n > &A, const comple &v)
 
template<CPPL_INT m, CPPL_INT n>
const zgematrix_small< m, n > & operator+ (const zgematrix_small< m, n > &A)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > operator- (const zgematrix_small< m, n > &A)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > operator+ (const zgematrix_small< m, n > &A, const zgematrix_small< m, n > &B)
 
template<CPPL_INT n>
zgematrix_small< n, n > operator+ (const zgematrix_small< n, n > &A, const zhematrix_small< n > &B)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > operator- (const zgematrix_small< m, n > &A, const zgematrix_small< m, n > &B)
 
template<CPPL_INT n>
zgematrix_small< n, n > operator- (const zgematrix_small< n, n > &A, const zhematrix_small< n > &B)
 
template<CPPL_INT m, CPPL_INT n>
zcovector_small< m > operator* (const zgematrix_small< m, n > &A, const zcovector_small< n > &B)
 
template<CPPL_INT m, CPPL_INT l, CPPL_INT n>
zgematrix_small< m, n > operator* (const zgematrix_small< m, l > &A, const zgematrix_small< l, n > &B)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > operator* (const zgematrix_small< m, n > &A, const zhematrix_small< n > &B)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > operator* (const zgematrix_small< m, n > &A, const double &v)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > operator* (const zgematrix_small< m, n > &A, const comple &v)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > operator/ (const zgematrix_small< m, n > &A, const double &v)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > operator/ (const zgematrix_small< m, n > &A, const comple &v)
 
template<CPPL_INT m, CPPL_INT n>
zgematrix_small< m, n > hadamerd (const zgematrix_small< m, n > &A, const zgematrix_small< m, n > &B)
 
template<CPPL_INT n>
zgematrix_small< n, n > hadamerd (const zgematrix_small< n, n > &A, const zhematrix_small< n > &B)
 

Function Documentation

template<CPPL_INT m, CPPL_INT n>
std::ostream& operator<< ( std::ostream &  s,
const zgematrix_small< m, n > &  A 
)
inline

operator<<

Definition at line 65 of file zgematrix_small-functions.hpp.

References i().

66 {CPPL_VERBOSE_REPORT;
67  s << std::setiosflags(std::ios::showpos);
68  for(CPPL_INT i=0; i<m; i++){
69  for(CPPL_INT j=0; j<n; j++){
70  s << " " << A(i,j);
71  }
72  s << std::endl;
73  }
74  return s;
75 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<n,m> t ( const zgematrix_small< m, n > &  A)
inline

return transposed zgematrix_small

Definition at line 158 of file zgematrix_small-functions.hpp.

References i().

159 {CPPL_VERBOSE_REPORT;
161  for(CPPL_INT i=0; i<m; i++){
162  for(CPPL_INT j=0; j<n; j++){
163  X(j,i) =A(i,j);
164  }
165  }
166  return X;
167 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT m, CPPL_INT n>
comple trace ( const zgematrix_small< m, n > &  A)
inline

return its trace

Definition at line 172 of file zgematrix_small-functions.hpp.

References i().

173 {CPPL_VERBOSE_REPORT;
174  comple trace =comple(0.,0);
175 
176  const CPPL_INT imax =std::min(m,n);
177  for(CPPL_INT i=0; i<imax; i++){
178  trace +=A(i,i);
179  }
180 
181  return trace;
182 }
_dgematrix i(const _dgbmatrix &mat)
comple trace(const zgematrix_small< m, n > &A)
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n>& operator+= ( zgematrix_small< m, n > &  A,
const zgematrix_small< m, n > &  B 
)
inline

zgematrix_small+=zgematrix_small operator

Definition at line 246 of file zgematrix_small-functions.hpp.

References zgematrix_small< m, n >::array.

247 {CPPL_VERBOSE_REPORT;
248  for(CPPL_INT k=0; k<m*n; k++){
249  A.array[k] +=B.array[k];
250  }
251  return A;
252 }
comple array[m *n]
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n>& operator-= ( zgematrix_small< m, n > &  A,
const zgematrix_small< m, n > &  B 
)
inline

zgematrix_small-=zgematrix_small operator

Definition at line 257 of file zgematrix_small-functions.hpp.

References zgematrix_small< m, n >::array.

258 {CPPL_VERBOSE_REPORT;
259  for(CPPL_INT k=0; k<m*n; k++){
260  A.array[k] -=B.array[k];
261  }
262  return A;
263 }
comple array[m *n]
template<CPPL_INT m, CPPL_INT l, CPPL_INT n>
zgematrix_small<m,n>& operator*= ( zgematrix_small< m, l > &  A,
const zgematrix_small< l, n > &  B 
)
inline

zgematrix_small*=zgematrix_small operator

Definition at line 268 of file zgematrix_small-functions.hpp.

References i(), and zgematrix_small< m, n >::zero().

269 {CPPL_VERBOSE_REPORT;
271  X.zero();
272  for(CPPL_INT i=0; i<m; i++){
273  for(CPPL_INT j=0; j<n; j++){
274  for(CPPL_INT k=0; k<l; k++){
275  X(i,j) += A(i,k)*B(k,j);
276  }
277  }
278  }
279  A =X;
280  return A;
281 }
_dgematrix i(const _dgbmatrix &mat)
zgematrix_small< m, n > & zero()
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n>& operator*= ( zgematrix_small< m, n > &  A,
const double &  v 
)
inline

zgematrix_small*=double operator

Definition at line 286 of file zgematrix_small-functions.hpp.

References zgematrix_small< m, n >::array.

287 {CPPL_VERBOSE_REPORT;
288  for(CPPL_INT k=0; k<m*n; k++){
289  A.array[k] *=v;
290  }
291  return A;
292 }
comple array[m *n]
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n>& operator*= ( zgematrix_small< m, n > &  A,
const comple &  v 
)
inline

zgematrix_small*=comple operator

Definition at line 297 of file zgematrix_small-functions.hpp.

References zgematrix_small< m, n >::array.

298 {CPPL_VERBOSE_REPORT;
299  for(CPPL_INT k=0; k<m*n; k++){
300  A.array[k] *=v;
301  }
302  return A;
303 }
comple array[m *n]
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n>& operator/= ( zgematrix_small< m, n > &  A,
const double &  v 
)
inline

zgematrix_small/=double operator

Definition at line 308 of file zgematrix_small-functions.hpp.

References zgematrix_small< m, n >::array.

309 {CPPL_VERBOSE_REPORT;
310  for(CPPL_INT k=0; k<m*n; k++){
311  A.array[k] /=v;
312  }
313  return A;
314 }
comple array[m *n]
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n>& operator/= ( zgematrix_small< m, n > &  A,
const comple &  v 
)
inline

zgematrix_small/=comple operator

Definition at line 318 of file zgematrix_small-functions.hpp.

References zgematrix_small< m, n >::array.

319 {CPPL_VERBOSE_REPORT;
320  for(CPPL_INT k=0; k<m*n; k++){
321  A.array[k] /=v;
322  }
323  return A;
324 }
comple array[m *n]
template<CPPL_INT m, CPPL_INT n>
const zgematrix_small<m,n>& operator+ ( const zgematrix_small< m, n > &  A)
inline

unary + operator

Definition at line 333 of file zgematrix_small-functions.hpp.

334 {CPPL_VERBOSE_REPORT;
335  return A;
336 }
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n> operator- ( const zgematrix_small< m, n > &  A)
inline

unary - operator

Definition at line 341 of file zgematrix_small-functions.hpp.

References i().

342 {CPPL_VERBOSE_REPORT;
344  for(CPPL_INT i=0; i<m; i++){
345  for(CPPL_INT j=0; j<n; j++){
346  X(i,j) =-A(i,j);
347  }
348  }
349  return X;
350 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n> operator+ ( const zgematrix_small< m, n > &  A,
const zgematrix_small< m, n > &  B 
)
inline

zgematrix_small+zgematrix_small operator

Definition at line 359 of file zgematrix_small-functions.hpp.

References i().

360 {CPPL_VERBOSE_REPORT;
362  for(int i=0; i<m; i++){
363  for(int j=0; j<n; j++){
364  C(i,j) =A(i,j)+B(i,j);
365  }
366  }
367  return C;
368 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT n>
zgematrix_small<n,n> operator+ ( const zgematrix_small< n, n > &  A,
const zhematrix_small< n > &  B 
)
inline

zgematrix_small+zhematrix_small operator

Definition at line 373 of file zgematrix_small-functions.hpp.

References i().

374 {CPPL_VERBOSE_REPORT;
376  for(CPPL_INT i=0; i<n; i++){
377  for(CPPL_INT j=0; j<i; j++){
378  X(i,j) =A(i,j)+B(i,j);
379  }
380  for(CPPL_INT j=i; j<n; j++){
381  X(i,j) =A(i,j)+B(j,i);
382  }
383  }
384  return X;
385 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n> operator- ( const zgematrix_small< m, n > &  A,
const zgematrix_small< m, n > &  B 
)
inline

zgematrix_small-zgematrix_small operator

Definition at line 390 of file zgematrix_small-functions.hpp.

References i().

391 {CPPL_VERBOSE_REPORT;
393  for(int i=0; i<m; i++){
394  for(int j=0; j<n; j++){
395  C(i,j)=A(i,j)-B(i,j);
396  }
397  }
398  return C;
399 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT n>
zgematrix_small<n,n> operator- ( const zgematrix_small< n, n > &  A,
const zhematrix_small< n > &  B 
)
inline

zgematrix_small-zhematrix_small operator

Definition at line 404 of file zgematrix_small-functions.hpp.

References i().

405 {CPPL_VERBOSE_REPORT;
407  for(CPPL_INT i=0; i<n; i++){
408  for(CPPL_INT j=0; j<=i; j++){
409  X(i,j)=A(i,j)-B(i,j);
410  }
411  for(CPPL_INT j=i+1; j<n; j++){
412  X(i,j)=A(i,j)-B(j,i);
413  }
414  }
415  return X;
416 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT m, CPPL_INT n>
zcovector_small<m> operator* ( const zgematrix_small< m, n > &  A,
const zcovector_small< n > &  B 
)
inline

zgematrix_small*zcovector_small operator

Definition at line 425 of file zgematrix_small-functions.hpp.

References i(), and zcovector_small< l >::zero().

426 {CPPL_VERBOSE_REPORT;
428  C.zero();
429  for(CPPL_INT i=0; i<m; i++){
430  for(CPPL_INT j=0; j<n; j++){
431  C(i) +=A(i,j)*B(j);
432  }
433  }
434  return C;
435 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision Column Vector Class.
zcovector_small< l > & zero()
template<CPPL_INT m, CPPL_INT l, CPPL_INT n>
zgematrix_small<m,n> operator* ( const zgematrix_small< m, l > &  A,
const zgematrix_small< l, n > &  B 
)
inline

zgematrix_small*zgematrix_small operator

Definition at line 440 of file zgematrix_small-functions.hpp.

References i(), and zgematrix_small< m, n >::zero().

441 {CPPL_VERBOSE_REPORT;
443  C.zero();
444  for(int i=0; i<m; i++){
445  for(int j=0; j<n; j++){
446  for(int k=0; k<l; k++){
447  C(i,j) +=A(i,k)*B(k,j);
448  }
449  }
450  }
451  return C;
452 }
_dgematrix i(const _dgbmatrix &mat)
zgematrix_small< m, n > & zero()
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n> operator* ( const zgematrix_small< m, n > &  A,
const zhematrix_small< n > &  B 
)
inline

zgematrix_small+zhematrix_small operator

Definition at line 457 of file zgematrix_small-functions.hpp.

References i(), and zgematrix_small< m, n >::zero().

458 {CPPL_VERBOSE_REPORT;
460  X.zero();
461  for(CPPL_INT i=0; i<m; i++){
462  for(CPPL_INT j=0; j<n; j++){
463  for(CPPL_INT k=0; k<j; k++){
464  X(i,j) +=A(i,k)*B(j,k);
465  }
466  for(CPPL_INT k=j; k<n; k++){
467  X(i,j) +=A(i,k)*B(k,j);
468  }
469  }
470  }
471  return X;
472 }
_dgematrix i(const _dgbmatrix &mat)
zgematrix_small< m, n > & zero()
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n> operator* ( const zgematrix_small< m, n > &  A,
const double &  v 
)
inline

zgematrix_small*double operator

Definition at line 477 of file zgematrix_small-functions.hpp.

References i().

478 {CPPL_VERBOSE_REPORT;
480  for(CPPL_INT i=0; i<m; i++){
481  for(CPPL_INT j=0; j<n; j++){
482  C(i,j) =A(i,j)*v;
483  }
484  }
485  return C;
486 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n> operator* ( const zgematrix_small< m, n > &  A,
const comple &  v 
)
inline

zgematrix_small*comple operator

Definition at line 491 of file zgematrix_small-functions.hpp.

References i().

492 {CPPL_VERBOSE_REPORT;
494  for(CPPL_INT i=0; i<m; i++){
495  for(CPPL_INT j=0; j<n; j++){
496  C(i,j) =A(i,j)*v;
497  }
498  }
499  return C;
500 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n> operator/ ( const zgematrix_small< m, n > &  A,
const double &  v 
)
inline

zgematrix_small/double operator

Definition at line 509 of file zgematrix_small-functions.hpp.

References i().

510 {CPPL_VERBOSE_REPORT;
512  for(CPPL_INT i=0; i<m; i++){
513  for(CPPL_INT j=0; j<n; j++){
514  C(i,j) =A(i,j)/v;
515  }
516  }
517  return C;
518 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n> operator/ ( const zgematrix_small< m, n > &  A,
const comple &  v 
)
inline

zgematrix_small/comple operator

Definition at line 523 of file zgematrix_small-functions.hpp.

References i().

524 {CPPL_VERBOSE_REPORT;
526  for(CPPL_INT i=0; i<m; i++){
527  for(CPPL_INT j=0; j<n; j++){
528  C(i,j) =A(i,j)/v;
529  }
530  }
531  return C;
532 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT m, CPPL_INT n>
zgematrix_small<m,n> hadamerd ( const zgematrix_small< m, n > &  A,
const zgematrix_small< m, n > &  B 
)
inline

Hadamerd product

Definition at line 541 of file zgematrix_small-functions.hpp.

References i().

542 {CPPL_VERBOSE_REPORT;
544  for(CPPL_INT i=0; i<m; i++){
545  for(CPPL_INT j=0; j<n; j++){
546  C(i,j) =A(i,j)*B(i,j);
547  }
548  }
549  return C;
550 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision General Dence Matrix Class.
template<CPPL_INT n>
zgematrix_small<n,n> hadamerd ( const zgematrix_small< n, n > &  A,
const zhematrix_small< n > &  B 
)
inline

Hadamerd product

Definition at line 555 of file zgematrix_small-functions.hpp.

References conj(), and i().

556 {CPPL_VERBOSE_REPORT;
558  for(CPPL_INT i=0; i<n; i++){
559  for(CPPL_INT j=0; j<=i; j++){
560  C(i,j) =A(i,j)*B(i,j);
561  }
562  for(CPPL_INT j=i+1; j<n; j++){
563  C(i,j) =A(i,j)*conj(B(j,i));
564  }
565  }
566  return C;
567 }
_dgematrix i(const _dgbmatrix &mat)
_zcovector conj(const _zcovector &vec)
Samll Complex Double-precision General Dence Matrix Class.