MaxIterationsStoppingCriterion

class itergp.methods.stopping_criteria.MaxIterationsStoppingCriterion(maxiter=None, problem_size_factor=10)

Bases: LinearSolverStoppingCriterion

Stop after a maximum number of iterations.

Stop when the solver has taken a maximum number of steps. The maximum number of iterations can either be specified in absolute terms or relative to the problem size.

Parameters
  • maxiter (Optional[int]) – Maximum number of steps the solver should take.

  • problem_size_factor (int) – If maxiter is None, stops after problem_size_factor * problem_size steps, where problem_size is the dimension of the solution to the linear system. Will be ignored otherwise.

Attributes Summary

maxiter

Maximum number of steps.

problem_size_factor

Problem size factor.

Methods Summary

__call__(solver_state)

Check whether the maximum number of iterations has been reached.

Attributes Documentation

maxiter

Maximum number of steps.

problem_size_factor

Problem size factor.

If maxiter is None, stops after problem_size_factor * problem_size steps, where problem_size is the dimension of the solution to the linear system. Will be ignored otherwise.

Methods Documentation

__call__(solver_state)[source]

Check whether the maximum number of iterations has been reached.

Parameters

solver_state (probnum.linalg.solvers.LinearSolverState) – Current state of the linear solver.

Return type

bool