Class IterativeSolverTask

java.lang.Object
org.ojalgo.matrix.task.iterative.IterativeSolverTask
All Implemented Interfaces:
MatrixTask<Double>, SolverTask<Double>
Direct Known Subclasses:
ConjugateGradientSolver, GaussSeidelSolver, JacobiSolver, MINRESSolver, ParallelGaussSeidelSolver, QMRSolver

public abstract class IterativeSolverTask extends Object implements SolverTask<Double>
Base class for iterative solvers of large linear systems [A][x]=[b]. Subclasses provide concrete stationary or Krylov algorithms while sharing input conversion, configuration, and stopping logic. Characteristics
  • Accepts both sparse and dense inputs by converting the system to a List<Equation> where rows can be iterated efficiently without assuming dense, contiguous storage.
  • Minimises allocations in hot loops by reusing buffers and operating directly on PhysicalStore and R064Store vectors.
  • Provides a common configuration and termination policy via NumberContext and an iteration limit.
Selected/reordered rows and columns
  • Implementations must work when the effective system is a selected or reordered subset of the original problem. The equation list may represent only some rows, and column indices may need to be remapped or compacted.
  • Do not assume a dense, contiguous column space. Always form row products using Equation.dot(org.ojalgo.structure.Access1D) and access the diagonal through Equation.getPivot().
  • The provided solution vector defines the active variable subspace; form residuals against that vector and the current row bodies only.
  • RHS values are carried by each Equation; use resolve(List, PhysicalStore, org.ojalgo.structure.Access1D) to update RHS between solves.
Preconditioners and solver compatibility Stopping criterion
  • Subclasses should measure a residual norm and stop when NumberContext.isSmall(double, double) deems it small relative to the RHS norm (or absolutely small when the RHS is zero), or when the iteration limit is reached.