warp.optim.linear.CR#
- class warp.optim.linear.CR(
- A,
- b,
- x,
- tol=None,
- atol=None,
- maxiter=0,
- M=None,
- callback=None,
- check_every=10,
- use_cuda_graph=True,
- *,
- restart=None,
Pre-allocated state for the Conjugate Residual solver.
See
LinearSolverStatefor the shared constructor parameters, plus:- Parameters:
restart (int | None) – Optional positive number of iterations between restarts. Each restart recomputes
b - A xand resets the search direction to limit finite-precision drift.A (array | BsrMatrix | LinearOperator)
b (array)
x (array)
tol (float | None)
atol (float | None)
maxiter (float | None)
M (array | BsrMatrix | LinearOperator | None)
callback (Callable | None)
check_every (int)
use_cuda_graph (bool)
The preconditioner
Mmay be freely changed (or toggled betweenNoneand a valid operator) between calls as long as the replacement operands match the construction-time shape, dtype, device, and batch layout.