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

Go to the source code of this file.

Classes

class  zgematrix_small< m, n >
 Samll Complex Double-precision General Dence Matrix Class. More...

Functions

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

Function Documentation

comple det ( const zgemat2 &  A) [inline]

calculate determinant

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

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

calculate inverse

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

References det().

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

calculate determinant

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

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

calculate inverse

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

References det().

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