aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/LU
diff options
context:
space:
mode:
authorGravatar Rasmus Munk Larsen <rmlarsen@google.com>2018-08-09 11:09:10 -0700
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2018-08-09 11:09:10 -0700
commit8603d80029581272a04f78959cb1636395fa47bc (patch)
tree429151908f1eb3d3876e2971dfc790e589b29afa /Eigen/src/LU
parent131ed1191fa5ccbe0265fcfccfc685642c388192 (diff)
Cast diagonalSize() to Scalar before multiplication. Without this, automatic differentiation in Ceres breaks because Scalar is a custom type that does not support multiplication by Index.
Diffstat (limited to 'Eigen/src/LU')
-rw-r--r--Eigen/src/LU/FullPivLU.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/LU/FullPivLU.h b/Eigen/src/LU/FullPivLU.h
index 50d1bb41b..8541dfa02 100644
--- a/Eigen/src/LU/FullPivLU.h
+++ b/Eigen/src/LU/FullPivLU.h
@@ -53,7 +53,7 @@ template<typename _MatrixType> struct traits<FullPivLU<_MatrixType> >
* Output: \verbinclude class_FullPivLU.out
*
* This class supports the \link InplaceDecomposition inplace decomposition \endlink mechanism.
- *
+ *
* \sa MatrixBase::fullPivLu(), MatrixBase::determinant(), MatrixBase::inverse()
*/
template<typename _MatrixType> class FullPivLU
@@ -320,7 +320,7 @@ template<typename _MatrixType> class FullPivLU
return m_usePrescribedThreshold ? m_prescribedThreshold
// this formula comes from experimenting (see "LU precision tuning" thread on the list)
// and turns out to be identical to Higham's formula used already in LDLt.
- : NumTraits<Scalar>::epsilon() * m_lu.diagonalSize();
+ : NumTraits<Scalar>::epsilon() * Scalar(m_lu.diagonalSize());
}
/** \returns the rank of the matrix of which *this is the LU decomposition.