From a1a26f45d377bfe18de0f34b1fce893fe992c209 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Fri, 19 Jun 2009 17:01:32 +0200 Subject: [PATCH] fix #14: make llt::solve() and also ldlt::solve() work with uninitialized result --- Eigen/src/Cholesky/LDLT.h | 8 ++++---- Eigen/src/Cholesky/LLT.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Eigen/src/Cholesky/LDLT.h b/Eigen/src/Cholesky/LDLT.h index 4729c3621..205b78a6d 100644 --- a/Eigen/src/Cholesky/LDLT.h +++ b/Eigen/src/Cholesky/LDLT.h @@ -68,8 +68,8 @@ template class LDLT /** \returns true if the matrix is positive definite */ inline bool isPositiveDefinite(void) const { return m_isPositiveDefinite; } - template - bool solve(const MatrixBase &b, MatrixBase *result) const; + template + bool solve(const MatrixBase &b, ResultType *result) const; template bool solveInPlace(MatrixBase &bAndX) const; @@ -152,9 +152,9 @@ void LDLT::compute(const MatrixType& a) * \sa LDLT::solveInPlace(), MatrixBase::ldlt() */ template -template +template bool LDLT -::solve(const MatrixBase &b, MatrixBase *result) const +::solve(const MatrixBase &b, ResultType *result) const { const int size = m_matrix.rows(); ei_assert(size==b.rows() && "LLT::solve(): invalid number of rows of the right hand side matrix b"); diff --git a/Eigen/src/Cholesky/LLT.h b/Eigen/src/Cholesky/LLT.h index 3d8789d6e..42c959f83 100644 --- a/Eigen/src/Cholesky/LLT.h +++ b/Eigen/src/Cholesky/LLT.h @@ -90,8 +90,8 @@ template class LLT /** \deprecated */ inline bool isPositiveDefinite(void) const { return m_isInitialized && m_isPositiveDefinite; } - template - bool solve(const MatrixBase &b, MatrixBase *result) const; + template + bool solve(const MatrixBase &b, ResultType *result) const; template bool solveInPlace(MatrixBase &bAndX) const; @@ -174,8 +174,8 @@ void LLT::compute(const MatrixType& a) * \sa LLT::solveInPlace(), MatrixBase::llt() */ template -template -bool LLT::solve(const MatrixBase &b, MatrixBase *result) const +template +bool LLT::solve(const MatrixBase &b, ResultType *result) const { ei_assert(m_isInitialized && "LLT is not initialized."); const int size = m_matrix.rows();