1 #ifndef vnl_algo_determinant_hxx_ 2 #define vnl_algo_determinant_hxx_ 10 # include <vcl_msvc_warnings.h> 18 return row0[0]*row1[1] - row0[1]*row1[0];
25 + row0[0]*row1[1]*row2[2]
26 - row0[0]*row2[1]*row1[2]
27 - row1[0]*row0[1]*row2[2]
28 + row1[0]*row2[1]*row0[2]
29 + row2[0]*row0[1]*row1[2]
30 - row2[0]*row1[1]*row0[2];
37 + row0[0]*row1[1]*row2[2]*row3[3]
38 - row0[0]*row1[1]*row3[2]*row2[3]
39 - row0[0]*row2[1]*row1[2]*row3[3]
40 + row0[0]*row2[1]*row3[2]*row1[3]
41 + row0[0]*row3[1]*row1[2]*row2[3]
42 - row0[0]*row3[1]*row2[2]*row1[3]
43 - row1[0]*row0[1]*row2[2]*row3[3]
44 + row1[0]*row0[1]*row3[2]*row2[3]
45 + row1[0]*row2[1]*row0[2]*row3[3]
46 - row1[0]*row2[1]*row3[2]*row0[3]
47 - row1[0]*row3[1]*row0[2]*row2[3]
48 + row1[0]*row3[1]*row2[2]*row0[3]
49 + row2[0]*row0[1]*row1[2]*row3[3]
50 - row2[0]*row0[1]*row3[2]*row1[3]
51 - row2[0]*row1[1]*row0[2]*row3[3]
52 + row2[0]*row1[1]*row3[2]*row0[3]
53 + row2[0]*row3[1]*row0[2]*row1[3]
54 - row2[0]*row3[1]*row1[2]*row0[3]
55 - row3[0]*row0[1]*row1[2]*row2[3]
56 + row3[0]*row0[1]*row2[2]*row1[3]
57 + row3[0]*row1[1]*row0[2]*row2[3]
58 - row3[0]*row1[1]*row2[2]*row0[3]
59 - row3[0]*row2[1]*row0[2]*row1[3]
60 + row3[0]*row2[1]*row1[2]*row0[3];
68 unsigned n = M.
rows();
69 assert(M.
cols() == n);
73 case 1:
return M[0][0];
83 for (
int t=0; t<5; ++t)
86 for (
unsigned int i=0; i<n; ++i) {
87 abs_t rn = tmp.
get_row(i).rms();
94 for (
unsigned int i=0; i<n; ++i) {
104 return T(scalings) * balanced_det;
114 #define VNL_DETERMINANT_INSTANTIATE_1(T) \ 115 template VNL_ALGO_EXPORT T vnl_determinant(T const *, T const *); \ 116 template VNL_ALGO_EXPORT T vnl_determinant(T const *, T const *, T const *); \ 117 template VNL_ALGO_EXPORT T vnl_determinant(T const *, T const *, T const *, T const *) 119 #define VNL_DETERMINANT_INSTANTIATE_2(T) \ 120 template VNL_ALGO_EXPORT T vnl_determinant(vnl_matrix<T > const &, bool) 122 #undef VNL_DETERMINANT_INSTANTIATE 123 #define VNL_DETERMINANT_INSTANTIATE(T) \ 124 VNL_DETERMINANT_INSTANTIATE_1(T); \ 125 VNL_DETERMINANT_INSTANTIATE_2(T) 127 #endif // vnl_algo_determinant_hxx_ unsigned int cols() const
Return the number of columns.
vnl_matrix & scale_row(unsigned row, T value)
Scales elements in given row by a factor T, and returns "*this".
Calculate inverse of a matrix using QR.
calculates the determinant of a matrix
Extract the Q*R decomposition of matrix M.
T determinant() const
Return the determinant of M. This is computed from M = Q R as follows:.
An ordinary mathematical matrix.
T vnl_determinant(vnl_matrix< T > const &M, bool balance=false)
evaluation using direct methods for sizes of 2x2, 3x3, and 4x4 or qr decomposition for other matrices...
vnl_vector< T > get_column(unsigned c) const
Get a vector equal to the given column.
vnl_vector< T > get_row(unsigned r) const
Get a vector equal to the given row.
unsigned int rows() const
Return the number of rows.
vnl_matrix & scale_column(unsigned col, T value)
Scales elements in given column by a factor T, and returns "*this".