mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 17:49:36 +08:00
Fix several uninitialized member from ctor
This commit is contained in:
parent
a476054879
commit
a7842daef2
@ -110,7 +110,7 @@ template<typename _MatrixType> class EigenSolver
|
||||
*
|
||||
* \sa compute() for an example.
|
||||
*/
|
||||
EigenSolver() : m_eivec(), m_eivalues(), m_isInitialized(false), m_realSchur(), m_matT(), m_tmp() {}
|
||||
EigenSolver() : m_eivec(), m_eivalues(), m_isInitialized(false), m_eigenvectorsOk(false), m_realSchur(), m_matT(), m_tmp() {}
|
||||
|
||||
/** \brief Default constructor with memory preallocation
|
||||
*
|
||||
|
@ -90,8 +90,9 @@ namespace Eigen {
|
||||
m_Z(size, size),
|
||||
m_workspace(size*2),
|
||||
m_maxIters(400),
|
||||
m_isInitialized(false)
|
||||
{ }
|
||||
m_isInitialized(false),
|
||||
m_computeQZ(true)
|
||||
{}
|
||||
|
||||
/** \brief Constructor; computes real QZ decomposition of given matrices
|
||||
*
|
||||
@ -108,9 +109,11 @@ namespace Eigen {
|
||||
m_Z(A.rows(),A.cols()),
|
||||
m_workspace(A.rows()*2),
|
||||
m_maxIters(400),
|
||||
m_isInitialized(false) {
|
||||
compute(A, B, computeQZ);
|
||||
}
|
||||
m_isInitialized(false),
|
||||
m_computeQZ(true)
|
||||
{
|
||||
compute(A, B, computeQZ);
|
||||
}
|
||||
|
||||
/** \brief Returns matrix Q in the QZ decomposition.
|
||||
*
|
||||
|
@ -122,7 +122,8 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
|
||||
m_eivalues(),
|
||||
m_subdiag(),
|
||||
m_info(InvalidInput),
|
||||
m_isInitialized(false)
|
||||
m_isInitialized(false),
|
||||
m_eigenvectorsOk(false)
|
||||
{ }
|
||||
|
||||
/** \brief Constructor, pre-allocates memory for dynamic-size matrices.
|
||||
@ -142,7 +143,8 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
|
||||
: m_eivec(size, size),
|
||||
m_eivalues(size),
|
||||
m_subdiag(size > 1 ? size - 1 : 1),
|
||||
m_isInitialized(false)
|
||||
m_isInitialized(false),
|
||||
m_eigenvectorsOk(false)
|
||||
{}
|
||||
|
||||
/** \brief Constructor; computes eigendecomposition of given matrix.
|
||||
@ -166,7 +168,8 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
|
||||
: m_eivec(matrix.rows(), matrix.cols()),
|
||||
m_eivalues(matrix.cols()),
|
||||
m_subdiag(matrix.rows() > 1 ? matrix.rows() - 1 : 1),
|
||||
m_isInitialized(false)
|
||||
m_isInitialized(false),
|
||||
m_eigenvectorsOk(false)
|
||||
{
|
||||
compute(matrix.derived(), options);
|
||||
}
|
||||
|
@ -76,12 +76,12 @@ class IncompleteCholesky : public SparseSolverBase<IncompleteCholesky<Scalar,_Up
|
||||
*
|
||||
* \sa IncompleteCholesky(const MatrixType&)
|
||||
*/
|
||||
IncompleteCholesky() : m_initialShift(1e-3),m_factorizationIsOk(false) {}
|
||||
IncompleteCholesky() : m_initialShift(1e-3),m_analysisIsOk(false),m_factorizationIsOk(false) {}
|
||||
|
||||
/** Constructor computing the incomplete factorization for the given matrix \a matrix.
|
||||
*/
|
||||
template<typename MatrixType>
|
||||
IncompleteCholesky(const MatrixType& matrix) : m_initialShift(1e-3),m_factorizationIsOk(false)
|
||||
IncompleteCholesky(const MatrixType& matrix) : m_initialShift(1e-3),m_analysisIsOk(false),m_factorizationIsOk(false)
|
||||
{
|
||||
compute(matrix);
|
||||
}
|
||||
|
@ -123,6 +123,7 @@ class PardisoImpl : public SparseSolverBase<Derived>
|
||||
};
|
||||
|
||||
PardisoImpl()
|
||||
: m_analysisIsOk(false), m_factorizationIsOk(false), m_pt(0)
|
||||
{
|
||||
eigen_assert((sizeof(StorageIndex) >= sizeof(_INTEGER_t) && sizeof(StorageIndex) <= 8) && "Non-supported index type");
|
||||
m_iparm.setZero();
|
||||
|
@ -74,13 +74,35 @@ class SPQR : public SparseSolverBase<SPQR<_MatrixType> >
|
||||
};
|
||||
public:
|
||||
SPQR()
|
||||
: m_ordering(SPQR_ORDERING_DEFAULT), m_allow_tol(SPQR_DEFAULT_TOL), m_tolerance (NumTraits<Scalar>::epsilon()), m_useDefaultThreshold(true)
|
||||
: m_analysisIsOk(false),
|
||||
m_factorizationIsOk(false),
|
||||
m_isRUpToDate(false),
|
||||
m_ordering(SPQR_ORDERING_DEFAULT),
|
||||
m_allow_tol(SPQR_DEFAULT_TOL),
|
||||
m_tolerance (NumTraits<Scalar>::epsilon()),
|
||||
m_cR(0),
|
||||
m_E(0),
|
||||
m_H(0),
|
||||
m_HPinv(0),
|
||||
m_HTau(0),
|
||||
m_useDefaultThreshold(true)
|
||||
{
|
||||
cholmod_l_start(&m_cc);
|
||||
}
|
||||
|
||||
explicit SPQR(const _MatrixType& matrix)
|
||||
: m_ordering(SPQR_ORDERING_DEFAULT), m_allow_tol(SPQR_DEFAULT_TOL), m_tolerance (NumTraits<Scalar>::epsilon()), m_useDefaultThreshold(true)
|
||||
: m_analysisIsOk(false),
|
||||
m_factorizationIsOk(false),
|
||||
m_isRUpToDate(false),
|
||||
m_ordering(SPQR_ORDERING_DEFAULT),
|
||||
m_allow_tol(SPQR_DEFAULT_TOL),
|
||||
m_tolerance (NumTraits<Scalar>::epsilon()),
|
||||
m_cR(0),
|
||||
m_E(0),
|
||||
m_H(0),
|
||||
m_HPinv(0),
|
||||
m_HTau(0),
|
||||
m_useDefaultThreshold(true)
|
||||
{
|
||||
cholmod_l_start(&m_cc);
|
||||
compute(matrix);
|
||||
|
@ -110,7 +110,7 @@ public:
|
||||
* The default constructor is useful in cases in which the user intends to
|
||||
* perform decompositions via BDCSVD::compute(const MatrixType&).
|
||||
*/
|
||||
BDCSVD() : m_algoswap(16), m_numIters(0)
|
||||
BDCSVD() : m_algoswap(16), m_isTranspose(false), m_compU(false), m_compV(false), m_numIters(0)
|
||||
{}
|
||||
|
||||
|
||||
|
@ -245,6 +245,10 @@ protected:
|
||||
: m_isInitialized(false),
|
||||
m_isAllocated(false),
|
||||
m_usePrescribedThreshold(false),
|
||||
m_computeFullU(false),
|
||||
m_computeThinU(false),
|
||||
m_computeFullV(false),
|
||||
m_computeThinV(false),
|
||||
m_computationOptions(0),
|
||||
m_rows(-1), m_cols(-1), m_diagSize(0)
|
||||
{
|
||||
|
@ -80,11 +80,19 @@ class SimplicialCholeskyBase : public SparseSolverBase<Derived>
|
||||
|
||||
/** Default constructor */
|
||||
SimplicialCholeskyBase()
|
||||
: m_info(Success), m_shiftOffset(0), m_shiftScale(1)
|
||||
: m_info(Success),
|
||||
m_factorizationIsOk(false),
|
||||
m_analysisIsOk(false),
|
||||
m_shiftOffset(0),
|
||||
m_shiftScale(1)
|
||||
{}
|
||||
|
||||
explicit SimplicialCholeskyBase(const MatrixType& matrix)
|
||||
: m_info(Success), m_shiftOffset(0), m_shiftScale(1)
|
||||
: m_info(Success),
|
||||
m_factorizationIsOk(false),
|
||||
m_analysisIsOk(false),
|
||||
m_shiftOffset(0),
|
||||
m_shiftScale(1)
|
||||
{
|
||||
derived().compute(matrix);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user