mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix computeInverseAndDetWithCheck for dynamic result matrices
libeigen/eigen!2312 Closes #2917
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
cc8c7cf0e6
commit
1d21d62fbc
@@ -308,8 +308,9 @@ inline void MatrixBase<Derived>::computeInverseAndDetWithCheck(ResultType& inver
|
||||
typename ResultType::Scalar& determinant,
|
||||
bool& invertible,
|
||||
const RealScalar& absDeterminantThreshold) const {
|
||||
// i'd love to put some static assertions there, but SFINAE means that they have no effect...
|
||||
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived, ResultType)
|
||||
eigen_assert(rows() == cols());
|
||||
inverse.resize(rows(), cols());
|
||||
// for 2x2, it's worth giving a chance to avoid evaluating.
|
||||
// for larger sizes, evaluating has negligible cost and limits code size.
|
||||
typedef std::conditional_t<RowsAtCompileTime == 2,
|
||||
@@ -343,8 +344,6 @@ template <typename ResultType>
|
||||
inline void MatrixBase<Derived>::computeInverseWithCheck(ResultType& inverse, bool& invertible,
|
||||
const RealScalar& absDeterminantThreshold) const {
|
||||
Scalar determinant;
|
||||
// i'd love to put some static assertions there, but SFINAE means that they have no effect...
|
||||
eigen_assert(rows() == cols());
|
||||
computeInverseAndDetWithCheck(inverse, determinant, invertible, absDeterminantThreshold);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user