mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 19:29:02 +08:00
Ensure info() implementation across all SolverBase derived types
This commit is contained in:
parent
f3e7d64f3d
commit
6f1a143418
@ -78,6 +78,14 @@ class SolverBase : public EigenBase<Derived> {
|
||||
template <typename Derived_>
|
||||
friend struct internal::solve_assertion;
|
||||
|
||||
ComputationInfo info() const {
|
||||
// CRTP static dispatch: Calls the 'info()' method on the derived class.
|
||||
// Derived must implement 'ComputationInfo info() const'.
|
||||
// If not implemented, name lookup falls back to this base method, causing
|
||||
// infinite recursion (detectable by -Winfinite-recursion).
|
||||
return derived().info();
|
||||
}
|
||||
|
||||
enum {
|
||||
RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
|
||||
ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
|
||||
|
@ -78,6 +78,17 @@ class FullPivLU : public SolverBase<FullPivLU<MatrixType_, PermutationIndex_> >
|
||||
typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime, PermutationIndex> PermutationPType;
|
||||
typedef typename MatrixType::PlainObject PlainObject;
|
||||
|
||||
/** \brief Reports whether the LU factorization was successful.
|
||||
*
|
||||
* \note This function always returns \c Success. It is provided for compatibility
|
||||
* with other factorization routines.
|
||||
* \returns \c Success
|
||||
*/
|
||||
ComputationInfo info() const {
|
||||
eigen_assert(m_isInitialized && "FullPivLU is not initialized.");
|
||||
return Success;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Default Constructor.
|
||||
*
|
||||
|
@ -90,6 +90,17 @@ class PartialPivLU : public SolverBase<PartialPivLU<MatrixType_, PermutationInde
|
||||
typedef Transpositions<RowsAtCompileTime, MaxRowsAtCompileTime, PermutationIndex> TranspositionType;
|
||||
typedef typename MatrixType::PlainObject PlainObject;
|
||||
|
||||
/** \brief Reports whether the LU factorization was successful.
|
||||
*
|
||||
* \note This function always returns \c Success. It is provided for compatibility
|
||||
* with other factorization routines.
|
||||
* \returns \c Success
|
||||
*/
|
||||
ComputationInfo info() const {
|
||||
eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
|
||||
return Success;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Default Constructor.
|
||||
*
|
||||
|
@ -82,6 +82,17 @@ class FullPivHouseholderQR : public SolverBase<FullPivHouseholderQR<MatrixType_,
|
||||
typedef typename internal::plain_col_type<MatrixType>::type ColVectorType;
|
||||
typedef typename MatrixType::PlainObject PlainObject;
|
||||
|
||||
/** \brief Reports whether the QR factorization was successful.
|
||||
*
|
||||
* \note This function always returns \c Success. It is provided for compatibility
|
||||
* with other factorization routines.
|
||||
* \returns \c Success
|
||||
*/
|
||||
ComputationInfo info() const {
|
||||
eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
|
||||
return Success;
|
||||
}
|
||||
|
||||
/** \brief Default Constructor.
|
||||
*
|
||||
* The default constructor is useful in cases in which the user intends to
|
||||
|
@ -75,6 +75,17 @@ class HouseholderQR : public SolverBase<HouseholderQR<MatrixType_>> {
|
||||
typedef HouseholderSequence<MatrixType, internal::remove_all_t<typename HCoeffsType::ConjugateReturnType>>
|
||||
HouseholderSequenceType;
|
||||
|
||||
/** \brief Reports whether the QR factorization was successful.
|
||||
*
|
||||
* \note This function always returns \c Success. It is provided for compatibility
|
||||
* with other factorization routines.
|
||||
* \returns \c Success
|
||||
*/
|
||||
ComputationInfo info() const {
|
||||
eigen_assert(m_isInitialized && "HouseHolderQR is not initialized.");
|
||||
return Success;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Default Constructor.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user