Go to the documentation of this file.
10 #ifndef EIGEN_LEAST_SQUARE_CONJUGATE_GRADIENT_H
11 #define EIGEN_LEAST_SQUARE_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 = normal_residual.squaredNorm();
56 if (residualNorm2 < threshold)
59 tol_error =
sqrt(residualNorm2 / rhsNorm2);
64 p = precond.solve(normal_residual);
71 tmp.noalias() =
mat *
p;
75 residual -=
alpha * tmp;
76 normal_residual =
mat.adjoint() * residual;
78 residualNorm2 = normal_residual.squaredNorm();
79 if(residualNorm2 < threshold)
82 z = precond.solve(normal_residual);
90 tol_error =
sqrt(residualNorm2 / rhsNorm2);
96 template<
typename _MatrixType,
97 typename _Preconditioner = LeastSquareDiagonalPreconditioner<typename _MatrixType::Scalar> >
102 template<
typename _MatrixType,
typename _Preconditioner>
148 template<
typename _MatrixType,
typename _Preconditioner>
178 template<
typename MatrixDerived>
184 template<
typename Rhs,
typename Dest>
198 #endif // EIGEN_LEAST_SQUARE_CONJUGATE_GRADIENT_H
Namespace containing all symbols from the Eigen library.
MatrixType::Scalar Scalar
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
MatrixType::RealScalar RealScalar
IterativeSolverBase< LeastSquaresConjugateGradient > Base
double beta(double a, double b)
_Preconditioner Preconditioner
LeastSquaresConjugateGradient()
void _solve_vector_with_guess_impl(const Rhs &b, Dest &x) const
Index maxIterations() const
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
A conjugate gradient solver for sparse (or dense) least-square problems.
_Preconditioner Preconditioner
LeastSquaresConjugateGradient(const EigenBase< MatrixDerived > &A)
const ActualMatrixType & matrix() const
~LeastSquaresConjugateGradient()
Preconditioner m_preconditioner
Jet< T, N > sqrt(const Jet< T, N > &f)
EIGEN_DONT_INLINE void least_square_conjugate_gradient(const MatrixType &mat, const Rhs &rhs, Dest &x, const Preconditioner &precond, Index &iters, typename Dest::RealScalar &tol_error)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
#define EIGEN_DONT_INLINE
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:41