Go to the documentation of this file.
10 #ifndef EIGEN_CONJUGATE_GRADIENT_H
11 #define EIGEN_CONJUGATE_GRADIENT_H
26 template<
typename MatrixType,
typename Rhs,
typename Dest,
typename Preconditioner>
29 const Preconditioner& precond,
Index& iters,
39 Index maxIters = iters;
55 RealScalar residualNorm2 = residual.squaredNorm();
56 if (residualNorm2 < threshold)
59 tol_error =
sqrt(residualNorm2 / rhsNorm2);
64 p = precond.solve(residual);
71 tmp.noalias() =
mat *
p;
75 residual -=
alpha * tmp;
77 residualNorm2 = residual.squaredNorm();
78 if(residualNorm2 < threshold)
81 z = precond.solve(residual);
89 tol_error =
sqrt(residualNorm2 / rhsNorm2);
95 template<
typename _MatrixType,
int _UpLo=
Lower,
96 typename _Preconditioner = DiagonalPreconditioner<typename _MatrixType::Scalar> >
101 template<
typename _MatrixType,
int _UpLo,
typename _Preconditioner>
157 template<
typename _MatrixType,
int _UpLo,
typename _Preconditioner>
191 template<
typename MatrixDerived>
197 template<
typename Rhs,
typename Dest>
203 TransposeInput = (!MatrixWrapper::MatrixFree)
205 && (!MatrixType::IsRowMajor)
213 >::
type SelfAdjointWrapper;
218 RowMajorWrapper row_mat(
matrix());
229 #endif // EIGEN_CONJUGATE_GRADIENT_H
Namespace containing all symbols from the Eigen library.
_Preconditioner Preconditioner
MatrixType::RealScalar RealScalar
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
_Preconditioner Preconditioner
double beta(double a, double b)
Index maxIterations() const
A conjugate gradient solver for sparse (or dense) self-adjoint problems.
MatrixType::Scalar Scalar
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Base class for linear iterative solvers.
NumTraits< Scalar >::Real RealScalar
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
const ActualMatrixType & matrix() const
IterativeSolverBase< ConjugateGradient > Base
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
#define EIGEN_IMPLIES(a, b)
Expression of an array as a mathematical vector or matrix.
MatrixWrapper::ActualMatrixType ActualMatrixType
Preconditioner m_preconditioner
EIGEN_DONT_INLINE void conjugate_gradient(const MatrixType &mat, const Rhs &rhs, Dest &x, const Preconditioner &precond, Index &iters, typename Dest::RealScalar &tol_error)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Jet< T, N > sqrt(const Jet< T, N > &f)
ConjugateGradient(const EigenBase< MatrixDerived > &A)
void _solve_vector_with_guess_impl(const Rhs &b, Dest &x) const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
#define EIGEN_DONT_INLINE
gtsam
Author(s):
autogenerated on Thu Dec 19 2024 04:00:52