Go to the documentation of this file.
13 #ifndef EIGEN_MINRES_H_
14 #define EIGEN_MINRES_H_
30 template<
typename MatrixType,
typename Rhs,
typename Dest,
typename Preconditioner>
33 const Preconditioner& precond,
Index& iters,
52 const Index maxIters(iters);
54 const RealScalar threshold2(tol_error*tol_error*rhsNorm2);
65 eigen_assert(beta_new2 >= 0.0 &&
"PRECONDITIONER IS NOT POSITIVE DEFINITE");
79 while ( iters < maxIters )
97 v_new.noalias() =
mat*
w -
beta*v_old;
100 w_new = precond.solve(v_new);
101 beta_new2 = v_new.dot(w_new);
102 eigen_assert(beta_new2 >= 0.0 &&
"PRECONDITIONER IS NOT POSITIVE DEFINITE");
103 beta_new =
sqrt(beta_new2);
118 p.noalias()=(
w-
r2*p_old-
r3*p_oold) /
r1;
119 x += beta_one*
c*eta*
p;
123 residualNorm2 *=
s*
s;
125 if ( residualNorm2 < threshold2)
136 tol_error =
std::sqrt(residualNorm2 / rhsNorm2);
141 template<
typename _MatrixType,
int _UpLo=
Lower,
142 typename _Preconditioner = IdentityPreconditioner>
147 template<
typename _MatrixType,
int _UpLo,
typename _Preconditioner>
194 template<
typename _MatrixType,
int _UpLo,
typename _Preconditioner>
228 template<
typename MatrixDerived>
235 template<
typename Rhs,
typename Dest>
241 TransposeInput = (!MatrixWrapper::MatrixFree)
243 && (!MatrixType::IsRowMajor)
251 >::
type SelfAdjointWrapper;
255 RowMajorWrapper row_mat(
matrix());
267 #endif // EIGEN_MINRES_H
Namespace containing all symbols from the Eigen library.
MINRES(const EigenBase< MatrixDerived > &A)
void _solve_impl(const Rhs &b, Dest &x) const
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
double beta(double a, double b)
A minimal residual solver for sparse symmetric problems.
_Preconditioner Preconditioner
_Preconditioner Preconditioner
Index maxIterations() const
Jet< T, N > pow(const Jet< T, N > &f, double g)
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
void _solve_vector_with_guess_impl(const Rhs &b, Dest &x) const
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
const ActualMatrixType & matrix() const
Array< int, Dynamic, 1 > v
EIGEN_DONT_INLINE void minres(const MatrixType &mat, const Rhs &rhs, Dest &x, const Preconditioner &precond, Index &iters, typename Dest::RealScalar &tol_error)
MatrixType::RealScalar RealScalar
IterativeSolverBase< MINRES > Base
#define EIGEN_IMPLIES(a, b)
Expression of an array as a mathematical vector or matrix.
MatrixWrapper::ActualMatrixType ActualMatrixType
Preconditioner m_preconditioner
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Jet< T, N > sqrt(const Jet< T, N > &f)
MatrixType::Scalar Scalar
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
#define EIGEN_DONT_INLINE
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:33:49