10 #ifndef EIGEN_ITERATIVE_SOLVER_BASE_H    11 #define EIGEN_ITERATIVE_SOLVER_BASE_H    17 template<
typename MatrixType>
    21   template <
typename T0>
    27   struct yes {
int a[1];};
    28   struct no  {
int a[2];};
    40 template<
typename MatrixType>
    46 template<typename MatrixType, bool MatrixFree = !internal::is_ref_compatible<MatrixType>::value>
    50 template<
typename MatrixType>
    55   template<
int UpLo> 
struct ConstSelfAdjointViewReturnType {
    64     : m_dummy(0,0), m_matrix(m_dummy)
    67   template<
typename InputType>
    72   const ActualMatrixType& 
matrix()
 const    77   template<
typename MatrixDerived>
    80     m_matrix.~Ref<
const MatrixType>();
    86     if(&(mat.derived()) != &m_matrix)
    88       m_matrix.~Ref<
const MatrixType>();
    99 template<
typename MatrixType>
   104   template<
int UpLo> 
struct ConstSelfAdjointViewReturnType
   126   void grab(
const MatrixType &mat)
   142 template< 
typename Derived>
   147   using Base::m_isInitialized;
   152   typedef typename MatrixType::Scalar 
Scalar;
   157     ColsAtCompileTime = MatrixType::ColsAtCompileTime,
   158     MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
   181   template<
typename MatrixDerived>
   183     : m_matrixWrapper(A.derived())
   196   template<
typename MatrixDerived>
   200     m_preconditioner.analyzePattern(matrix());
   201     m_isInitialized = 
true;
   202     m_analysisIsOk = 
true;
   203     m_info = m_preconditioner.info();
   216   template<
typename MatrixDerived>
   219     eigen_assert(m_analysisIsOk && 
"You must first call analyzePattern()"); 
   221     m_preconditioner.factorize(matrix());
   222     m_factorizationIsOk = 
true;
   223     m_info = m_preconditioner.info();
   237   template<
typename MatrixDerived>
   241     m_preconditioner.compute(matrix());
   242     m_isInitialized = 
true;
   243     m_analysisIsOk = 
true;
   244     m_factorizationIsOk = 
true;
   245     m_info = m_preconditioner.info();
   267     m_tolerance = tolerance;
   283     return (m_maxIterations<0) ? 2*matrix().cols() : m_maxIterations;
   291     m_maxIterations = maxIters;
   298     eigen_assert(m_isInitialized && 
"ConjugateGradient is not initialized.");
   307     eigen_assert(m_isInitialized && 
"ConjugateGradient is not initialized.");
   316   template<
typename Rhs,
typename Guess>
   320     eigen_assert(m_isInitialized && 
"Solver is not initialized.");
   321     eigen_assert(derived().rows()==b.rows() && 
"solve(): invalid number of rows of the right hand side matrix b");
   328     eigen_assert(m_isInitialized && 
"IterativeSolverBase is not initialized.");
   333   template<
typename Rhs, 
typename DestDerived>
   338     Index rhsCols = b.cols();
   339     Index size = b.rows();
   340     DestDerived& dest(aDest.
derived());
   341     typedef typename DestDerived::Scalar DestScalar;
   346     typename DestDerived::PlainObject tmp(cols(),rhsCols);
   347     for(
Index k=0; k<rhsCols; ++k)
   350       tx = derived().solve(tb);
   351       tmp.col(k) = tx.sparseView(0);
   359     m_isInitialized = 
false;
   360     m_analysisIsOk = 
false;
   361     m_factorizationIsOk = 
false;
   362     m_maxIterations = -1;
   371     return m_matrixWrapper.matrix();
   374   template<
typename InputType>
   377     m_matrixWrapper.grab(A);
   394 #endif // EIGEN_ITERATIVE_SOLVER_BASE_H 
generic_matrix_wrapper(const InputType &mat)
const ActualMatrixType & matrix() const
EIGEN_DEVICE_FUNC void swap(DenseBase< OtherDerived > &other)
Pseudo expression representing a solving operation. 
Derived & setTolerance(const RealScalar &tolerance)
void grab(const MatrixType &mat)
static yes test(const Ref< const T > &, int)
ComputationInfo info() const
IterativeSolverBase(const EigenBase< MatrixDerived > &A)
static MatrixType ms_from
void init(const M_string &remappings)
void _solve_impl(const Rhs &b, SparseMatrixBase< DestDerived > &aDest) const
A base class for sparse solvers. 
any_conversion(const volatile T &)
internal::generic_matrix_wrapper< MatrixType > MatrixWrapper
internal::traits< Derived >::Preconditioner Preconditioner
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
const Preconditioner & preconditioner() const
void grab(const EigenBase< MatrixDerived > &mat)
generic_matrix_wrapper(const MatrixType &mat)
Derived & factorize(const EigenBase< MatrixDerived > &A)
MatrixType::StorageIndex StorageIndex
SparseSolverBase< Derived > Base
RealScalar tolerance() const
MatrixType ActualMatrixType
const ActualMatrixType & matrix() const
MatrixType::Scalar Scalar
Base class of any sparse matrices or sparse expressions. 
MatrixWrapper::ActualMatrixType ActualMatrixType
Derived & analyzePattern(const EigenBase< MatrixDerived > &A)
Preconditioner m_preconditioner
Derived & compute(const EigenBase< MatrixDerived > &A)
ActualMatrixType m_matrix
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API. 
const ActualMatrixType & matrix() const
const SolveWithGuess< Derived, Rhs, Guess > solveWithGuess(const MatrixBase< Rhs > &b, const Guess &x0) const
Ref< const MatrixType > ActualMatrixType
Derived & setMaxIterations(Index maxIters)
A matrix or vector expression mapping an existing expression. 
ActualMatrixType::template ConstSelfAdjointViewReturnType< UpLo >::Type Type
const Derived & derived() const
MatrixType::RealScalar RealScalar
Preconditioner & preconditioner()
void grab(const Ref< const MatrixType > &mat)
The matrix class, also used for vectors and row-vectors. 
internal::traits< Derived >::MatrixType MatrixType
const ActualMatrixType * mp_matrix
Base class for linear iterative solvers. 
MatrixWrapper m_matrixWrapper
EIGEN_DEVICE_FUNC Derived & derived()
Base class for all dense matrices, vectors, and expressions. 
Index maxIterations() const
void grab(const InputType &A)