vnl_det.h
Go to the documentation of this file.
1 // This is core/vnl/vnl_det.h
2 #ifndef vnl_det_h_
3 #define vnl_det_h_
4 //:
5 // \file
6 // \brief Direct evaluation of 2x2, 3x3 and 4x4 determinants.
7 // \author fsm
8 //
9 // \verbatim
10 // Modifications
11 // Peter Vanroose - 15 Oct. 2001 - Renamed from vnl_determinant to vnl_det
12 // Peter Vanroose - 15 Oct. 2001 - Added vnl_matrix_fixed interface
13 // \endverbatim
14 
15 #include <vnl/vnl_matrix_fixed.h>
16 #include "vnl/vnl_export.h"
17 
18 //: 2x2 matrix
19 template <class T> VNL_EXPORT T vnl_det(T const *row0,
20  T const *row1);
21 
22 //: 3x3 matrix
23 template <class T> VNL_EXPORT T vnl_det(T const *row0,
24  T const *row1,
25  T const *row2);
26 
27 //: 4x4 matrix
28 template <class T> VNL_EXPORT T vnl_det(T const *row0,
29  T const *row1,
30  T const *row2,
31  T const *row3);
32 
33 //: Determinant of small size matrices
34 // \relatesalso vnl_matrix_fixed
35 template <class T>
36 inline T vnl_det(vnl_matrix_fixed<T,1,1> const& m) { return m[0][0]; }
37 
38 //: Determinant of small size matrices
39 // \relatesalso vnl_matrix_fixed
40 template <class T>
41 inline T vnl_det(vnl_matrix_fixed<T,2,2> const& m) { return vnl_det(m[0],m[1]); }
42 
43 //: Determinant of small size matrices
44 // \relatesalso vnl_matrix_fixed
45 template <class T>
46 inline T vnl_det(vnl_matrix_fixed<T,3,3> const& m) { return vnl_det(m[0],m[1],m[2]); }
47 
48 //: Determinant of small size matrices
49 // \relatesalso vnl_matrix_fixed
50 template <class T>
51 inline T vnl_det(vnl_matrix_fixed<T,4,4> const& m) { return vnl_det(m[0],m[1],m[2],m[3]); }
52 
53 #endif // vnl_det_h_
#define m
Definition: vnl_vector.h:43
Fixed size, stack-stored, space-efficient matrix.
Definition: vnl_fwd.h:23
fixed size matrix
T vnl_det(vnl_matrix_fixed< T, 1, 1 > const &m)
Determinant of small size matrices.
Definition: vnl_det.h:36