10#ifndef EIGEN_DETERMINANT_H
11#define EIGEN_DETERMINANT_H
17template<
typename Derived>
19inline const typename Derived::Scalar bruteforce_det3_helper
20(
const MatrixBase<Derived>& matrix,
int a,
int b,
int c)
22 return matrix.coeff(0,a)
23 * (matrix.coeff(1,b) * matrix.coeff(2,c) - matrix.coeff(1,c) * matrix.coeff(2,b));
26template<
typename Derived,
27 int DeterminantType = Derived::RowsAtCompileTime
32 if(Derived::ColsAtCompileTime==
Dynamic && m.rows()==0)
34 return m.partialPivLu().determinant();
40 static inline EIGEN_DEVICE_FUNC
49 static inline EIGEN_DEVICE_FUNC
52 return m.coeff(0,0) * m.coeff(1,1) - m.coeff(1,0) * m.coeff(0,1);
58 static inline EIGEN_DEVICE_FUNC
61 return bruteforce_det3_helper(m,0,1,2)
62 - bruteforce_det3_helper(m,1,0,2)
63 + bruteforce_det3_helper(m,2,0,1);
70 static EIGEN_DEVICE_FUNC
71 Scalar run(
const Derived& m)
83 return internal::pmadd(-m(0,3),
d3_0, m(1,3)*
d3_1) +
84 internal::pmadd(-m(2,3),
d3_2, m(3,3)*
d3_3);
87 static EIGEN_DEVICE_FUNC
90 return m(
i0,0) * m(
i1,1) - m(
i1,0) * m(
i0,1);
93 static EIGEN_DEVICE_FUNC
96 return internal::pmadd(m(
i0,2),
d0, internal::pmadd(-m(
i1,2),
d1, m(
i2,2)*
d2));
106template<
typename Derived>
110 eigen_assert(rows() == cols());
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition Constants.h:22
Definition Determinant.h:29
Definition ForwardDeclarations.h:17