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

Go to the source code of this file.

Functions

comple det (const zgemat2 &A)
 
zgemat2 inv (const zgemat2 &A)
 
comple det (const zgemat3 &A)
 
zgemat3 inv (const zgemat3 &A)
 

Function Documentation

comple det ( const zgemat2 &  A)
inline

calculate determinant

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

Referenced by inv().

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

calculate inverse

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

References det().

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

calculate determinant

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

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

calculate inverse

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

References det().

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