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>
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)
182 template<
typename MatType>
206 template<
typename MatrixType>
209 template<
typename MatrixType>
212 template<
typename MatrixType>
215 template<
typename MatrixType>
218 template<
typename Rhs>
219 inline const Rhs&
solve(
const Rhs& b)
const {
return b; }
EIGEN_DEVICE_FUNC RealReturnType real() const
Definition: CommonCwiseUnaryOps.h:100
#define EIGEN_NOEXCEPT
Definition: Macros.h:1418
#define EIGEN_CONSTEXPR
Definition: Macros.h:787
#define eigen_assert(x)
Definition: Macros.h:1037
A preconditioner based on the digonal entries.
Definition: BasicPreconditioners.h:37
const Solve< DiagonalPreconditioner, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: BasicPreconditioners.h:95
bool m_isInitialized
Definition: BasicPreconditioners.h:107
Vector::StorageIndex StorageIndex
Definition: BasicPreconditioners.h:41
DiagonalPreconditioner & factorize(const MatType &mat)
Definition: BasicPreconditioners.h:65
void _solve_impl(const Rhs &b, Dest &x) const
Definition: BasicPreconditioners.h:89
_Scalar Scalar
Definition: BasicPreconditioners.h:38
DiagonalPreconditioner & compute(const MatType &mat)
Definition: BasicPreconditioners.h:82
@ MaxColsAtCompileTime
Definition: BasicPreconditioners.h:44
@ ColsAtCompileTime
Definition: BasicPreconditioners.h:43
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: BasicPreconditioners.h:55
ComputationInfo info()
Definition: BasicPreconditioners.h:103
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: BasicPreconditioners.h:56
Vector m_invdiag
Definition: BasicPreconditioners.h:106
DiagonalPreconditioner(const MatType &mat)
Definition: BasicPreconditioners.h:50
DiagonalPreconditioner()
Definition: BasicPreconditioners.h:47
Matrix< Scalar, Dynamic, 1 > Vector
Definition: BasicPreconditioners.h:39
DiagonalPreconditioner & analyzePattern(const MatType &)
Definition: BasicPreconditioners.h:59
A naive preconditioner which approximates any matrix as the identity matrix.
Definition: BasicPreconditioners.h:201
IdentityPreconditioner & factorize(const MatrixType &)
Definition: BasicPreconditioners.h:213
ComputationInfo info()
Definition: BasicPreconditioners.h:221
IdentityPreconditioner(const MatrixType &)
Definition: BasicPreconditioners.h:207
IdentityPreconditioner & analyzePattern(const MatrixType &)
Definition: BasicPreconditioners.h:210
const Rhs & solve(const Rhs &b) const
Definition: BasicPreconditioners.h:219
IdentityPreconditioner()
Definition: BasicPreconditioners.h:204
IdentityPreconditioner & compute(const MatrixType &)
Definition: BasicPreconditioners.h:216
Jacobi preconditioner for LeastSquaresConjugateGradient.
Definition: BasicPreconditioners.h:129
LeastSquareDiagonalPreconditioner & compute(const MatType &mat)
Definition: BasicPreconditioners.h:183
LeastSquareDiagonalPreconditioner()
Definition: BasicPreconditioners.h:136
_Scalar Scalar
Definition: BasicPreconditioners.h:130
ComputationInfo info()
Definition: BasicPreconditioners.h:188
LeastSquareDiagonalPreconditioner & factorize(const MatType &mat)
Definition: BasicPreconditioners.h:151
LeastSquareDiagonalPreconditioner(const MatType &mat)
Definition: BasicPreconditioners.h:139
Vector m_invdiag
Definition: BasicPreconditioners.h:106
NumTraits< Scalar >::Real RealScalar
Definition: BasicPreconditioners.h:131
DiagonalPreconditioner< _Scalar > Base
Definition: BasicPreconditioners.h:132
LeastSquareDiagonalPreconditioner & analyzePattern(const MatType &)
Definition: BasicPreconditioners.h:145
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:50
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition: PlainObjectBase.h:271
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
Definition: CwiseNullaryOp.h:562
Pseudo expression representing a solving operation.
Definition: Solve.h:63
ComputationInfo
Definition: Constants.h:440
@ Success
Definition: Constants.h:442
EIGEN_DEVICE_FUNC bool abs2(bool x)
Definition: MathFunctions.h:1292
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
const int Dynamic
Definition: Constants.h:22
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:233
#define const
Definition: zconf.h:233