core/vnl/vnl_det.h
Go to the documentation of this file.
00001 // This is core/vnl/vnl_det.h
00002 #ifndef vnl_det_h_
00003 #define vnl_det_h_
00004 //:
00005 //  \file
00006 //  \brief Direct evaluation of 2x2, 3x3 and 4x4 determinants.
00007 //  \author fsm
00008 //
00009 // \verbatim
00010 //  Modifications
00011 //  Peter Vanroose - 15 Oct. 2001 - Renamed from vnl_determinant to vnl_det
00012 //  Peter Vanroose - 15 Oct. 2001 - Added vnl_matrix_fixed interface
00013 // \endverbatim
00014 
00015 #include <vnl/vnl_matrix_fixed.h>
00016 
00017 //: 2x2 matrix
00018 template <class T> T vnl_det(T const *row0,
00019                              T const *row1);
00020 
00021 //: 3x3 matrix
00022 template <class T> T vnl_det(T const *row0,
00023                              T const *row1,
00024                              T const *row2);
00025 
00026 //: 4x4 matrix
00027 template <class T> T vnl_det(T const *row0,
00028                              T const *row1,
00029                              T const *row2,
00030                              T const *row3);
00031 
00032 //: Determinant of small size matrices
00033 // \relatesalso vnl_matrix_fixed
00034 template <class T>
00035 inline T vnl_det(vnl_matrix_fixed<T,1,1> const& m) { return m[0][0]; }
00036 
00037 //: Determinant of small size matrices
00038 // \relatesalso vnl_matrix_fixed
00039 template <class T>
00040 inline T vnl_det(vnl_matrix_fixed<T,2,2> const& m) { return vnl_det(m[0],m[1]); }
00041 
00042 //: Determinant of small size matrices
00043 // \relatesalso vnl_matrix_fixed
00044 template <class T>
00045 inline T vnl_det(vnl_matrix_fixed<T,3,3> const& m) { return vnl_det(m[0],m[1],m[2]); }
00046 
00047 //: Determinant of small size matrices
00048 // \relatesalso vnl_matrix_fixed
00049 template <class T>
00050 inline T vnl_det(vnl_matrix_fixed<T,4,4> const& m) { return vnl_det(m[0],m[1],m[2],m[3]); }
00051 
00052 #endif // vnl_det_h_