10 #ifndef EIGEN_DETERMINANT_H 11 #define EIGEN_DETERMINANT_H 17 template<
typename Derived>
18 inline const typename Derived::Scalar bruteforce_det3_helper
19 (
const MatrixBase<Derived>& matrix,
int a,
int b,
int c)
21 return matrix.coeff(0,a)
22 * (matrix.coeff(1,b) * matrix.coeff(2,c) - matrix.coeff(1,c) * matrix.coeff(2,b));
25 template<
typename Derived>
26 const typename Derived::Scalar bruteforce_det4_helper
27 (
const MatrixBase<Derived>& matrix,
int j,
int k,
int m,
int n)
29 return (matrix.coeff(j,0) * matrix.coeff(k,1) - matrix.coeff(k,0) * matrix.coeff(j,1))
30 * (matrix.coeff(m,2) * matrix.coeff(n,3) - matrix.coeff(n,2) * matrix.coeff(m,3));
33 template<
typename Derived,
34 int DeterminantType = Derived::RowsAtCompileTime
39 if(Derived::ColsAtCompileTime==
Dynamic && m.rows()==0)
41 return m.partialPivLu().determinant();
57 return m.coeff(0,0) * m.coeff(1,1) - m.coeff(1,0) * m.coeff(0,1);
65 return bruteforce_det3_helper(m,0,1,2)
66 - bruteforce_det3_helper(m,1,0,2)
67 + bruteforce_det3_helper(m,2,0,1);
76 return bruteforce_det4_helper(m,0,1,2,3)
77 - bruteforce_det4_helper(m,0,2,1,3)
78 + bruteforce_det4_helper(m,0,3,1,2)
79 + bruteforce_det4_helper(m,1,2,0,3)
80 - bruteforce_det4_helper(m,1,3,0,2)
81 + bruteforce_det4_helper(m,2,3,0,1);
91 template<
typename Derived>
94 eigen_assert(rows() == cols());
101 #endif // EIGEN_DETERMINANT_H Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
Definition: Determinant.h:35
Definition: BandTriangularSolver.h:13
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
Definition: ForwardDeclarations.h:17
Scalar determinant() const
Definition: Determinant.h:92