MixedStrategy

class itergp.methods.MixedStrategy(base_policies, iters, atol=1e-06, rtol=1e-06, maxiter=None)

Bases: ProbabilisticLinearSolver

Iterative approximation method with a mixed strategy.

Parameters
  • base_policies – Policies which make up the MixedPolicy.

  • iters – Until which iteration (non-inclusive) to use the policy in the corresponding position in base_policies. Assumed to be sorted in increasing order. If iters has one fewer entry than base_policies, the last policy is used for all remaining iterations.

  • atol – Absolute tolerance.

  • rtol – Relative tolerance.

  • maxiter – Maximum number of iterations.

Methods Summary

solve(prior, problem[, rng])

Solve the linear system.

solve_iterator(prior, problem[, rng])

Generator implementing the solver iteration.

Methods Documentation

solve(prior, problem, rng=None)

Solve the linear system.

Parameters
Returns

  • belief – Posterior belief \((\mathsf{x}, \mathsf{A}, \mathsf{H}, \mathsf{b})\) over the solution \(x\), the system matrix \(A\), its (pseudo-)inverse \(H=A^\dagger\) and the right hand side \(b\).

  • solver_state – Final state of the solver.

Return type

Tuple[LinearSystemBelief, LinearSolverState]

solve_iterator(prior, problem, rng=None)

Generator implementing the solver iteration.

This function allows stepping through the solver iteration one step at a time and exposes the internal solver state.

Parameters
Yields

solver_state – State of the probabilistic linear solver.

Return type

Generator[LinearSolverState, None, None]