diff options
author | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2014-09-23 14:28:23 +0200 |
---|---|---|
committer | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2014-09-23 14:28:23 +0200 |
commit | 36448c9e287935b8c408791bf88b2907292d6c80 (patch) | |
tree | 841afdf4ea165433ad3b0f797498441815344eeb /Eigen/src/SPQRSupport | |
parent | de0d8a010e8cee66901786e0e2819beeaa5cb253 (diff) |
Make constructors explicit if they could lead to unintended implicit conversion
Diffstat (limited to 'Eigen/src/SPQRSupport')
-rw-r--r-- | Eigen/src/SPQRSupport/SuiteSparseQRSupport.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h b/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h index bcdc981d7..44f6a1acb 100644 --- a/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +++ b/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h @@ -65,7 +65,7 @@ class SPQR : public SparseSolverBase<SPQR<_MatrixType> > typedef typename _MatrixType::RealScalar RealScalar; typedef UF_long Index ; typedef SparseMatrix<Scalar, ColMajor, Index> MatrixType; - typedef PermutationMatrix<Dynamic, Dynamic> PermutationType; + typedef Map<PermutationMatrix<Dynamic, Dynamic, Index> > PermutationType; public: SPQR() : m_ordering(SPQR_ORDERING_DEFAULT), m_allow_tol(SPQR_DEFAULT_TOL), m_tolerance (NumTraits<Scalar>::epsilon()) @@ -73,7 +73,7 @@ class SPQR : public SparseSolverBase<SPQR<_MatrixType> > cholmod_l_start(&m_cc); } - SPQR(const _MatrixType& matrix) + explicit SPQR(const _MatrixType& matrix) : m_ordering(SPQR_ORDERING_DEFAULT), m_allow_tol(SPQR_DEFAULT_TOL), m_tolerance (NumTraits<Scalar>::epsilon()) { cholmod_l_start(&m_cc); @@ -164,11 +164,7 @@ class SPQR : public SparseSolverBase<SPQR<_MatrixType> > PermutationType colsPermutation() const { eigen_assert(m_isInitialized && "Decomposition is not initialized."); - Index n = m_cR->ncol; - PermutationType colsPerm(n); - for(Index j = 0; j <n; j++) colsPerm.indices()(j) = m_E[j]; - return colsPerm; - + return PermutationType(m_E, m_cR->ncol); } /** * Gets the rank of the matrix. |