Expand description
Solver — value-typed session API that holds an IpoptApplication,
its TNLP, and the converged KKT factor between calls.
This is Phase 3a of the factor-reuse work tracked in pounce#16. It is the public surface for callers who want to:
- Run a normal IPM solve, then
- Issue many cheap operations against the converged factor
(
kkt_solve,parametric_step) without going through theset_on_convergedcallback shape thatcrate::SensSolverequires.
§Usage
ⓘ
use pounce_sensitivity::Solver;
use std::cell::RefCell;
use std::rc::Rc;
let app = make_configured_app();
let tnlp: Rc<RefCell<dyn TNLP>> = Rc::new(RefCell::new(MyTnlp));
let mut solver = Solver::new(app, tnlp);
let status = solver.solve();
assert!(solver.converged().is_some());
// Issue any number of back-solves against the same factor:
let dim = solver.kkt_dim().unwrap();
let mut lhs = vec![0.0; dim];
let rhs = vec![1.0; dim];
solver.kkt_solve(&rhs, &mut lhs).unwrap();
// Parametric step with respect to a set of pinned equality
// constraints (same interpretation as [`crate::SensSolve`]):
let dx = solver.parametric_step(&[2, 3], &[-0.5, 0.0]).unwrap();§Scope of Phase 3a
- In:
solve(),converged(),kkt_solve(),parametric_step(),block_dims()/kkt_dim(). - Deferred to Phase 3b:
resolve()(warm-start that reuses the linear backend pool),compute_reduced_hessian()on the Solver (currently only available throughcrate::SensSolve), and theparametric_mpc/sensitivity_sessionexample binaries.
Structs§
- Converged
State - State captured at convergence: the user-visible iterate plus the
PdSensBacksolverthat wraps the converged KKT factor. - Solver
- Session-style solver: holds an
IpoptApplication, its TNLP, and the converged factor between calls.
Enums§
- Solver
Error - Errors returned by post-convergence operations on
Solver.