pub struct PdFullSpaceSolver {
pub min_refinement_steps: Index,
pub max_refinement_steps: Index,
pub residual_ratio_max: Number,
pub residual_ratio_singular: Number,
pub residual_improvement_factor: Number,
pub neg_curv_test_tol: Number,
/* private fields */
}Fields§
§min_refinement_steps: Index§max_refinement_steps: Index§residual_ratio_max: Number§residual_ratio_singular: Number§residual_improvement_factor: Number§neg_curv_test_tol: NumberNegative-curvature test tolerance (neg_curv_test_tol_). Zero
disables the heuristic; matches upstream’s RegisterOptions
default. The non-zero branch is not exercised in v1.0.
Implementations§
Source§impl PdFullSpaceSolver
impl PdFullSpaceSolver
pub fn new( aug_solver: Box<dyn AugSystemSolver>, perturb: Rc<RefCell<PdPerturbationHandler>>, ) -> Self
pub fn aug_solver(&self) -> &dyn AugSystemSolver
pub fn aug_solver_mut(&mut self) -> &mut dyn AugSystemSolver
Sourcepub fn wrap_aug_solver<F>(&mut self, wrap: F)
pub fn wrap_aug_solver<F>(&mut self, wrap: F)
Replace the underlying AugSystemSolver by passing the
existing one through the supplied wrapper closure. Used by the
restoration phase to decorate the inner StdAugSystemSolver
with AugRestoSystemSolver (which performs the 8-block →
4-block Schur reduction before delegating).
Sourcepub fn solve(
&mut self,
data: &IpoptDataHandle,
cq: &IpoptCqHandle,
nlp: &Rc<RefCell<dyn IpoptNlp>>,
alpha: Number,
beta: Number,
rhs: &IteratesVector,
res: &mut IteratesVectorMut,
allow_inexact: bool,
improve_solution: bool,
) -> bool
pub fn solve( &mut self, data: &IpoptDataHandle, cq: &IpoptCqHandle, nlp: &Rc<RefCell<dyn IpoptNlp>>, alpha: Number, beta: Number, rhs: &IteratesVector, res: &mut IteratesVectorMut, allow_inexact: bool, improve_solution: bool, ) -> bool
Solve the full PD system. res = α · M⁻¹ · rhs + β · res_in,
matching IpPDFullSpaceSolver::Solve. Returns true on
success. The iterate fields used to assemble the system are
pulled from data (W, curr) and cq (jacobians, slacks,
sigmas).
Sourcepub fn solve_many_cached<F1, F2>(
&mut self,
data: &IpoptDataHandle,
cq: &IpoptCqHandle,
nlp: &Rc<RefCell<dyn IpoptNlp>>,
n_rhs: usize,
write_rhs: F1,
write_lhs: F2,
) -> Option<bool>
pub fn solve_many_cached<F1, F2>( &mut self, data: &IpoptDataHandle, cq: &IpoptCqHandle, nlp: &Rc<RefCell<dyn IpoptNlp>>, n_rhs: usize, write_rhs: F1, write_lhs: F2, ) -> Option<bool>
Batched back-substitution against the cached KKT factor for
n_rhs right-hand sides, sharing one
pounce_linsol::TSymLinearSolver::multi_solve call with
nrhs > 1. Each column k pulls its RHS through write_rhs(k, &mut iv) and emits its solution through write_lhs(k, &iv) —
closures over the caller’s flat / strided buffer keep the
rhs/sol IteratesVectorMut scratch out of the API surface.
Returns:
Some(true)— fast path executed against the cached factor.Some(false)— fast path was attempted but the linsol reported a back-solve failure.None— fast path not taken. Either the matrix tags differ from the last successfulSelf::solve(cache miss), the matrix has not been considered yet, or the underlyingAugSystemSolverdoes not implementAugSystemSolver::try_resolve_many_flat. The caller should fall back to loopingSelf::solve.
Used by pounce_sensitivity::PdSensBacksolver::solve_many for
the JaxProblem jacrev backward path, where every cotangent
re-solves against the same converged factor (pounce#77 follow-up).
Sourcepub fn solve_many_cached_flat(
&mut self,
data: &IpoptDataHandle,
cq: &IpoptCqHandle,
nlp: &Rc<RefCell<dyn IpoptNlp>>,
n_rhs: usize,
rhs_flat: &[Number],
lhs_flat: &mut [Number],
block_dims: [usize; 8],
) -> Option<bool>
pub fn solve_many_cached_flat( &mut self, data: &IpoptDataHandle, cq: &IpoptCqHandle, nlp: &Rc<RefCell<dyn IpoptNlp>>, n_rhs: usize, rhs_flat: &[Number], lhs_flat: &mut [Number], block_dims: [usize; 8], ) -> Option<bool>
Flat-slice cached-factor multi-RHS path. Same cache-check
semantics as Self::solve_many_cached but operates on
row-major (n_rhs, total) flat buffers without going through
IteratesVectorMut or any dyn Vector / dyn Matrix dispatch
in the per-RHS inner loops — the eight source blocks
(slack_{x,s}_{l,u}, z_{l,u}, v_{l,u}) get downcast to
DenseVector once at the top, the four bound-expansion matrices
(px_l, px_u, pd_l, pd_u) get downcast to
ExpansionMatrix once, and Phase 1 / Phase 3 then run as raw
&[Number] / &mut [Number] arithmetic on the flat buffers.
total is the sum of the eight block_dims entries (in the
same (x, s, y_c, y_d, z_l, z_u, v_l, v_u) order that
IteratesVector uses); rhs_flat.len() == lhs_flat.len() == n_rhs * total.
Returns None (caller should fall back to
Self::solve_many_cached) when:
- the cache check fails (matrix tags differ),
- any block source vector is not a
DenseVectoror is homogeneous (uniform-scalar) on a non-empty block, - any bound-expansion matrix is not an
ExpansionMatrix, - the underlying
AugSystemSolverdoesn’t implementAugSystemSolver::try_resolve_many_flat.
Returns Some(true) on success, Some(false) on linsol back-
solve failure.
Used by pounce_sensitivity::PdSensBacksolver::solve_many as
the fastest tier of the JaxProblem jacrev backward path
(pounce#77 follow-up).
Trait Implementations§
Source§impl PdSystemSolver for PdFullSpaceSolver
impl PdSystemSolver for PdFullSpaceSolver
Source§fn solve_status(&self) -> ESymSolverStatus
fn solve_status(&self) -> ESymSolverStatus
super::pd_full_space_solver::PdFullSpaceSolver::solve will
implement it once IteratesVector is wired through.Auto Trait Implementations§
impl Freeze for PdFullSpaceSolver
impl !RefUnwindSafe for PdFullSpaceSolver
impl !Send for PdFullSpaceSolver
impl !Sync for PdFullSpaceSolver
impl Unpin for PdFullSpaceSolver
impl UnsafeUnpin for PdFullSpaceSolver
impl !UnwindSafe for PdFullSpaceSolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more