10 #ifndef EIGEN_BASIC_PRECONDITIONERS_H 11 #define EIGEN_BASIC_PRECONDITIONERS_H 35 template <
typename _Scalar>
49 template<
typename MatType>
58 template<
typename MatType>
64 template<
typename MatType>
68 for(
int j=0; j<mat.outerSize(); ++j)
70 typename MatType::InnerIterator it(mat,j);
71 while(it && it.index()!=j) ++it;
72 if(it && it.index()==j && it.value()!=
Scalar(0))
81 template<
typename MatType>
88 template<
typename Rhs,
typename Dest>
99 &&
"DiagonalPreconditioner::solve(): invalid number of rows of the right hand side matrix b");
127 template <
typename _Scalar>
133 using Base::m_invdiag;
138 template<
typename MatType>
144 template<
typename MatType>
150 template<
typename MatType>
155 if(MatType::IsRowMajor)
158 for(
Index j=0; j<mat.outerSize(); ++j)
160 for(
typename MatType::InnerIterator it(mat,j); it; ++it)
163 for(
Index j=0; j<mat.cols(); ++j)
169 for(
Index j=0; j<mat.outerSize(); ++j)
171 RealScalar
sum = mat.innerVector(j).squaredNorm();
172 if(sum>RealScalar(0))
178 Base::m_isInitialized =
true;
182 template<
typename MatType>
206 template<
typename MatrixType>
209 template<
typename MatrixType>
212 template<
typename MatrixType>
215 template<
typename MatrixType>
218 template<
typename Rhs>
226 #endif // EIGEN_BASIC_PRECONDITIONERS_H A preconditioner based on the digonal entries.
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
LeastSquareDiagonalPreconditioner()
LeastSquareDiagonalPreconditioner(const MatType &mat)
EIGEN_DEVICE_FUNC RealReturnType real() const
LeastSquareDiagonalPreconditioner & compute(const MatType &mat)
NumTraits< Scalar >::Real RealScalar
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
IdentityPreconditioner & analyzePattern(const MatrixType &)
LeastSquareDiagonalPreconditioner & factorize(const MatType &mat)
DiagonalPreconditioner< _Scalar > Base
Jacobi preconditioner for LeastSquaresConjugateGradient.
DiagonalPreconditioner & factorize(const MatType &mat)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
DiagonalPreconditioner & compute(const MatType &mat)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
LeastSquareDiagonalPreconditioner & analyzePattern(const MatType &)
const mpreal sum(const mpreal tab[], const unsigned long int n, int &status, mp_rnd_t mode=mpreal::get_default_rnd())
DiagonalPreconditioner & analyzePattern(const MatType &)
const Solve< DiagonalPreconditioner, Rhs > solve(const MatrixBase< Rhs > &b) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Abs2ReturnType abs2() const
IdentityPreconditioner & compute(const MatrixType &)
Matrix< Scalar, Dynamic, 1 > Vector
const Rhs & solve(const Rhs &b) const
DiagonalPreconditioner(const MatType &mat)
A naive preconditioner which approximates any matrix as the identity matrix.
Vector::StorageIndex StorageIndex
void _solve_impl(const Rhs &b, Dest &x) const
Pseudo expression representing a solving operation.
IdentityPreconditioner & factorize(const MatrixType &)
EIGEN_DEVICE_FUNC const Scalar & b
Base class for all dense matrices, vectors, and expressions.
IdentityPreconditioner(const MatrixType &)