mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-09 06:31:47 +08:00
fix #14: make llt::solve() and also ldlt::solve() work with uninitialized result
This commit is contained in:
parent
f5ae3a4b5a
commit
a1a26f45d3
@ -68,8 +68,8 @@ template<typename MatrixType> class LDLT
|
|||||||
/** \returns true if the matrix is positive definite */
|
/** \returns true if the matrix is positive definite */
|
||||||
inline bool isPositiveDefinite(void) const { return m_isPositiveDefinite; }
|
inline bool isPositiveDefinite(void) const { return m_isPositiveDefinite; }
|
||||||
|
|
||||||
template<typename RhsDerived, typename ResDerived>
|
template<typename RhsDerived, typename ResultType>
|
||||||
bool solve(const MatrixBase<RhsDerived> &b, MatrixBase<ResDerived> *result) const;
|
bool solve(const MatrixBase<RhsDerived> &b, ResultType *result) const;
|
||||||
|
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool solveInPlace(MatrixBase<Derived> &bAndX) const;
|
bool solveInPlace(MatrixBase<Derived> &bAndX) const;
|
||||||
@ -152,9 +152,9 @@ void LDLT<MatrixType>::compute(const MatrixType& a)
|
|||||||
* \sa LDLT::solveInPlace(), MatrixBase::ldlt()
|
* \sa LDLT::solveInPlace(), MatrixBase::ldlt()
|
||||||
*/
|
*/
|
||||||
template<typename MatrixType>
|
template<typename MatrixType>
|
||||||
template<typename RhsDerived, typename ResDerived>
|
template<typename RhsDerived, typename ResultType>
|
||||||
bool LDLT<MatrixType>
|
bool LDLT<MatrixType>
|
||||||
::solve(const MatrixBase<RhsDerived> &b, MatrixBase<ResDerived> *result) const
|
::solve(const MatrixBase<RhsDerived> &b, ResultType *result) const
|
||||||
{
|
{
|
||||||
const int size = m_matrix.rows();
|
const int size = m_matrix.rows();
|
||||||
ei_assert(size==b.rows() && "LLT::solve(): invalid number of rows of the right hand side matrix b");
|
ei_assert(size==b.rows() && "LLT::solve(): invalid number of rows of the right hand side matrix b");
|
||||||
|
@ -90,8 +90,8 @@ template<typename MatrixType> class LLT
|
|||||||
/** \deprecated */
|
/** \deprecated */
|
||||||
inline bool isPositiveDefinite(void) const { return m_isInitialized && m_isPositiveDefinite; }
|
inline bool isPositiveDefinite(void) const { return m_isInitialized && m_isPositiveDefinite; }
|
||||||
|
|
||||||
template<typename RhsDerived, typename ResDerived>
|
template<typename RhsDerived, typename ResultType>
|
||||||
bool solve(const MatrixBase<RhsDerived> &b, MatrixBase<ResDerived> *result) const;
|
bool solve(const MatrixBase<RhsDerived> &b, ResultType *result) const;
|
||||||
|
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool solveInPlace(MatrixBase<Derived> &bAndX) const;
|
bool solveInPlace(MatrixBase<Derived> &bAndX) const;
|
||||||
@ -174,8 +174,8 @@ void LLT<MatrixType>::compute(const MatrixType& a)
|
|||||||
* \sa LLT::solveInPlace(), MatrixBase::llt()
|
* \sa LLT::solveInPlace(), MatrixBase::llt()
|
||||||
*/
|
*/
|
||||||
template<typename MatrixType>
|
template<typename MatrixType>
|
||||||
template<typename RhsDerived, typename ResDerived>
|
template<typename RhsDerived, typename ResultType>
|
||||||
bool LLT<MatrixType>::solve(const MatrixBase<RhsDerived> &b, MatrixBase<ResDerived> *result) const
|
bool LLT<MatrixType>::solve(const MatrixBase<RhsDerived> &b, ResultType *result) const
|
||||||
{
|
{
|
||||||
ei_assert(m_isInitialized && "LLT is not initialized.");
|
ei_assert(m_isInitialized && "LLT is not initialized.");
|
||||||
const int size = m_matrix.rows();
|
const int size = m_matrix.rows();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user