10 #ifndef EIGEN_BASIC_PRECONDITIONERS_H
11 #define EIGEN_BASIC_PRECONDITIONERS_H
37 template <
typename Scalar_>
51 template<
typename MatType>
60 template<
typename MatType>
66 template<
typename MatType>
70 for(
int j=0;
j<
mat.outerSize(); ++
j)
72 typename MatType::InnerIterator it(
mat,
j);
73 while(it && it.index()!=
j) ++it;
74 if(it && it.index()==
j && it.value()!=
Scalar(0))
83 template<
typename MatType>
90 template<
typename Rhs,
typename Dest>
101 &&
"DiagonalPreconditioner::solve(): invalid number of rows of the right hand side matrix b");
129 template <
typename Scalar_>
140 template<
typename MatType>
146 template<
typename MatType>
152 template<
typename MatType>
157 if(MatType::IsRowMajor)
162 for(
typename MatType::InnerIterator it(
mat,
j); it; ++it)
184 template<
typename MatType>
208 template<
typename MatrixType>
211 template<
typename MatrixType>
214 template<
typename MatrixType>
217 template<
typename MatrixType>
220 template<
typename Rhs>
221 inline const Rhs&
solve(
const Rhs&
b)
const {
return b; }
RealReturnType real() const
Matrix< float, 1, Dynamic > MatrixType
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
A preconditioner based on the digonal entries.
DiagonalPreconditioner & factorize(const MatType &mat)
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
DiagonalPreconditioner & analyzePattern(const MatType &)
void _solve_impl(const Rhs &b, Dest &x) const
DiagonalPreconditioner(const MatType &mat)
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
DiagonalPreconditioner & compute(const MatType &mat)
const Solve< DiagonalPreconditioner, Rhs > solve(const MatrixBase< Rhs > &b) const
Vector::StorageIndex StorageIndex
Matrix< Scalar, Dynamic, 1 > Vector
A naive preconditioner which approximates any matrix as the identity matrix.
IdentityPreconditioner & factorize(const MatrixType &)
IdentityPreconditioner(const MatrixType &)
IdentityPreconditioner & analyzePattern(const MatrixType &)
const Rhs & solve(const Rhs &b) const
IdentityPreconditioner & compute(const MatrixType &)
Jacobi preconditioner for LeastSquaresConjugateGradient.
LeastSquareDiagonalPreconditioner & compute(const MatType &mat)
LeastSquareDiagonalPreconditioner & analyzePattern(const MatType &)
DiagonalPreconditioner< Scalar_ > Base
LeastSquareDiagonalPreconditioner()
LeastSquareDiagonalPreconditioner & factorize(const MatType &mat)
LeastSquareDiagonalPreconditioner(const MatType &mat)
NumTraits< Scalar >::Real RealScalar
Base class for all dense matrices, vectors, and expressions.
Derived & setZero(Index size)
constexpr void resize(Index rows, Index cols)
Pseudo expression representing a solving operation.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.