mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Make constructors explicit if they could lead to unintended implicit conversion
This commit is contained in:
@@ -550,7 +550,7 @@ template<typename _MatrixType, int QRPreconditioner> class JacobiSVD
|
||||
* according to the specified problem size.
|
||||
* \sa JacobiSVD()
|
||||
*/
|
||||
JacobiSVD(Index rows, Index cols, unsigned int computationOptions = 0)
|
||||
explicit JacobiSVD(Index rows, Index cols, unsigned int computationOptions = 0)
|
||||
{
|
||||
allocate(rows, cols, computationOptions);
|
||||
}
|
||||
@@ -565,7 +565,7 @@ template<typename _MatrixType, int QRPreconditioner> class JacobiSVD
|
||||
* Thin unitaries are only available if your matrix type has a Dynamic number of columns (for example MatrixXf). They also are not
|
||||
* available with the (non-default) FullPivHouseholderQR preconditioner.
|
||||
*/
|
||||
JacobiSVD(const MatrixType& matrix, unsigned int computationOptions = 0)
|
||||
explicit JacobiSVD(const MatrixType& matrix, unsigned int computationOptions = 0)
|
||||
{
|
||||
compute(matrix, computationOptions);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ template<typename _MatrixType> class UpperBidiagonalization
|
||||
typedef Matrix<Scalar, ColsAtCompileTimeMinusOne, 1> SuperDiagVectorType;
|
||||
typedef HouseholderSequence<
|
||||
const MatrixType,
|
||||
CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, const Diagonal<const MatrixType,0> >
|
||||
const typename internal::remove_all<typename Diagonal<const MatrixType,0>::ConjugateReturnType>::type
|
||||
> HouseholderUSequenceType;
|
||||
typedef HouseholderSequence<
|
||||
const typename internal::remove_all<typename MatrixType::ConjugateReturnType>::type,
|
||||
@@ -53,7 +53,7 @@ template<typename _MatrixType> class UpperBidiagonalization
|
||||
*/
|
||||
UpperBidiagonalization() : m_householder(), m_bidiagonal(), m_isInitialized(false) {}
|
||||
|
||||
UpperBidiagonalization(const MatrixType& matrix)
|
||||
explicit UpperBidiagonalization(const MatrixType& matrix)
|
||||
: m_householder(matrix.rows(), matrix.cols()),
|
||||
m_bidiagonal(matrix.cols(), matrix.cols()),
|
||||
m_isInitialized(false)
|
||||
|
||||
Reference in New Issue
Block a user