CPPLapack
 All Classes Files Functions Variables Friends Pages
Classes | Functions
zhematrix_small.hpp File Reference

Go to the source code of this file.

Classes

class  zhematrix_small< n >
 Samll Complex Double-precision Symmetric Matrix Class. More...
 

Functions

comple det (const zhemat2 &)
 
zhemat2 inv (const zhemat2 &)
 
comple det (const zhemat3 &)
 
zhemat3 inv (const zhemat3 &)
 

Function Documentation

comple det ( const zhemat2 &  A)
inline

calculate determinant

Definition at line 3 of file zhematrix_small-specialized.hpp.

Referenced by inv().

4 {CPPL_VERBOSE_REPORT;
5  return A(0,0)*A(1,1) -A(1,0)*A(1,0);
6 }
zhemat2 inv ( const zhemat2 &  A)
inline

calculate inverse

Definition at line 10 of file zhematrix_small-specialized.hpp.

References det().

11 {CPPL_VERBOSE_REPORT;
12  const comple Adet( det(A) );
13  zhemat2 Ainv;
14  Ainv(0,0)= A(1,1)/Adet;
15  Ainv(1,0)=-A(1,0)/Adet; Ainv(1,1)= A(0,0)/Adet;
16  return Ainv;
17 }
comple det(const zhemat2 &A)
comple det ( const zhemat3 &  A)
inline

calculate determinant

Definition at line 25 of file zhematrix_small-specialized.hpp.

26 {CPPL_VERBOSE_REPORT;
27  return
28  +A(0,0)*A(1,1)*A(2,2) -A(0,0)*A(2,1)*A(2,1)
29  +A(1,0)*A(2,1)*A(2,0) -A(1,0)*A(1,0)*A(2,2)
30  +A(2,0)*A(1,0)*A(2,1) -A(2,0)*A(1,1)*A(2,0);
31 }
zhemat3 inv ( const zhemat3 &  A)
inline

calculate inverse

Definition at line 35 of file zhematrix_small-specialized.hpp.

References det().

36 {CPPL_VERBOSE_REPORT;
37  const comple Adet( det(A) );
38  zhemat3 Ainv;
39  Ainv(0,0) =(A(1,1)*A(2,2)-A(2,1)*A(2,1))/Adet;
40  Ainv(1,0) =(A(2,1)*A(2,0)-A(1,0)*A(2,2))/Adet;
41  Ainv(1,1) =(A(0,0)*A(2,2)-A(2,0)*A(2,0))/Adet;
42  Ainv(2,0) =(A(1,0)*A(2,1)-A(1,1)*A(2,0))/Adet;
43  Ainv(2,1) =(A(1,0)*A(2,0)-A(0,0)*A(2,1))/Adet;
44  Ainv(2,2) =(A(0,0)*A(1,1)-A(1,0)*A(1,0))/Adet;
45  return Ainv;
46 }
comple det(const zhemat2 &A)