mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-15 07:10:37 +08:00
Make pivoting HouseholderQR compatible with custom scalar types
This commit is contained in:
parent
9fdc6258cf
commit
6b6071866b
@ -350,7 +350,7 @@ template<typename _MatrixType> class ColPivHouseholderQR
|
|||||||
return m_usePrescribedThreshold ? m_prescribedThreshold
|
return m_usePrescribedThreshold ? m_prescribedThreshold
|
||||||
// this formula comes from experimenting (see "LU precision tuning" thread on the list)
|
// 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.
|
// and turns out to be identical to Higham's formula used already in LDLt.
|
||||||
: NumTraits<Scalar>::epsilon() * m_qr.diagonalSize();
|
: NumTraits<Scalar>::epsilon() * RealScalar(m_qr.diagonalSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \returns the number of nonzero pivots in the QR decomposition.
|
/** \returns the number of nonzero pivots in the QR decomposition.
|
||||||
|
@ -346,7 +346,7 @@ template<typename _MatrixType> class FullPivHouseholderQR
|
|||||||
return m_usePrescribedThreshold ? m_prescribedThreshold
|
return m_usePrescribedThreshold ? m_prescribedThreshold
|
||||||
// this formula comes from experimenting (see "LU precision tuning" thread on the list)
|
// 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.
|
// and turns out to be identical to Higham's formula used already in LDLt.
|
||||||
: NumTraits<Scalar>::epsilon() * m_qr.diagonalSize();
|
: NumTraits<Scalar>::epsilon() * RealScalar(m_qr.diagonalSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \returns the number of nonzero pivots in the QR decomposition.
|
/** \returns the number of nonzero pivots in the QR decomposition.
|
||||||
@ -417,7 +417,7 @@ FullPivHouseholderQR<MatrixType>& FullPivHouseholderQR<MatrixType>::compute(cons
|
|||||||
|
|
||||||
m_temp.resize(cols);
|
m_temp.resize(cols);
|
||||||
|
|
||||||
m_precision = NumTraits<Scalar>::epsilon() * size;
|
m_precision = NumTraits<Scalar>::epsilon() * RealScalar(size);
|
||||||
|
|
||||||
m_rows_transpositions.resize(size);
|
m_rows_transpositions.resize(size);
|
||||||
m_cols_transpositions.resize(size);
|
m_cols_transpositions.resize(size);
|
||||||
|
Loading…
Reference in New Issue
Block a user