CPPLapack
 All Classes Files Functions Variables Friends
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.

{VERBOSE_REPORT;
  return A(0,0)*A(1,1) -A(1,0)*A(1,0);
}
zhemat2 inv ( const zhemat2 &  A) [inline]

calculate inverse

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

References det().

{VERBOSE_REPORT;
  const comple Adet( det(A) );
  zhemat2 Ainv;
  Ainv(0,0)= A(1,1)/Adet;
  Ainv(1,0)=-A(1,0)/Adet;  Ainv(1,1)= A(0,0)/Adet;
  return Ainv;
}
comple det ( const zhemat3 &  A) [inline]

calculate determinant

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

{VERBOSE_REPORT;
  return
    +A(0,0)*A(1,1)*A(2,2) -A(0,0)*A(2,1)*A(2,1)
    +A(1,0)*A(2,1)*A(2,0) -A(1,0)*A(1,0)*A(2,2)
    +A(2,0)*A(1,0)*A(2,1) -A(2,0)*A(1,1)*A(2,0);
}
zhemat3 inv ( const zhemat3 &  A) [inline]

calculate inverse

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

References det().

{VERBOSE_REPORT;
  const comple Adet( det(A) );
  zhemat3 Ainv;
  Ainv(0,0) =(A(1,1)*A(2,2)-A(2,1)*A(2,1))/Adet;
  Ainv(1,0) =(A(2,1)*A(2,0)-A(1,0)*A(2,2))/Adet;
  Ainv(1,1) =(A(0,0)*A(2,2)-A(2,0)*A(2,0))/Adet;
  Ainv(2,0) =(A(1,0)*A(2,1)-A(1,1)*A(2,0))/Adet;
  Ainv(2,1) =(A(1,0)*A(2,0)-A(0,0)*A(2,1))/Adet;
  Ainv(2,2) =(A(0,0)*A(1,1)-A(1,0)*A(1,0))/Adet;
  return Ainv;
}
 All Classes Files Functions Variables Friends