pub struct SensApplication<B>where
B: SensBacksolver,{ /* private fields */ }Expand description
User-facing entry point for sensitivity analysis on a converged pounce solve.
Mirrors Ipopt::SensApplication from
SensApplication.hpp:35-188.
Phase D ships only the skeleton — construction + Run-style
dispatch over the Phase B.1 numerical components. The option-table
integration with pounce-algorithm::OptionsList is via
register_options below; calling code reads option values from
the application’s owning OptionsList and configures SensOptions
before invoking SensApplication::run_*.
Implementations§
Source§impl<B> SensApplication<B>where
B: SensBacksolver,
impl<B> SensApplication<B>where
B: SensBacksolver,
Sourcepub fn new(
a_data: IndexSchurData,
backsolver: B,
options: SensOptions,
) -> SensApplication<B>
pub fn new( a_data: IndexSchurData, backsolver: B, options: SensOptions, ) -> SensApplication<B>
Build a SensApplication from a converged backsolver, a parameter-row SchurData, and pre-resolved options.
Equivalent of upstream’s SensApplication::Run setup
path (SensApplication.cpp:127-198)
but split so the construction is testable without the
IpoptApplication plumbing.
Sourcepub fn compute_reduced_hessian(&mut self, out: &mut [f64]) -> boolwhere
B: Clone,
pub fn compute_reduced_hessian(&mut self, out: &mut [f64]) -> boolwhere
B: Clone,
Compute the reduced Hessian into the caller-supplied
row-/column-major buffer (column-major in pounce, matching
DenseGenSchurDriver). Buffer length must be n² where
n = a_data.nrows(). Mirrors the
compute_red_hessian=true branch of upstream
SensApplication::Run.
Returns false if the underlying schur computation fails.
Sourcepub fn compute_reduced_hessian_eigen(
&mut self,
hr_out: &mut [f64],
eigvals_out: &mut [f64],
eigvecs_out: &mut [f64],
) -> boolwhere
B: Clone,
pub fn compute_reduced_hessian_eigen(
&mut self,
hr_out: &mut [f64],
eigvals_out: &mut [f64],
eigvecs_out: &mut [f64],
) -> boolwhere
B: Clone,
Compute the reduced Hessian and its symmetric eigendecomposition
in one pass. hr_out is the column-major n² Hessian buffer
(same shape as Self::compute_reduced_hessian); eigvals_out
receives the n eigenvalues in ascending order; eigvecs_out
receives the n² column-major eigenvector matrix (column j
is the eigenvector for eigvals_out[j], sign-pinned by
pounce_linalg::symmetric_eigen so the direction reproduces).
Mirrors the rh_eigendecomp=true branch of upstream
SensReducedHessianCalculator::ComputeReducedHessian.
Returns false if either the Schur reduction or the
eigendecomposition fails (or any buffer is mis-sized).
Sourcepub fn run_sens_step(
&mut self,
b_data: &IndexSchurData,
rhs_u: &[f64],
du: &mut [f64],
dx_full: &mut [f64],
) -> boolwhere
B: Clone,
pub fn run_sens_step(
&mut self,
b_data: &IndexSchurData,
rhs_u: &[f64],
du: &mut [f64],
dx_full: &mut [f64],
) -> boolwhere
B: Clone,
Compute one sensitivity step: given rhs_u (length
a_data.nrows()) the Schur-space parameter perturbation,
produce du (Schur-space step) and dx_full (KKT-space
step). Mirrors upstream’s run_sens=true flow.
dx_full must be the length of the backsolver’s state
dimension. rhs_u.len() == du.len() == a_data.nrows().
Returns false if the Schur driver factor fails or the inner
backsolves fail.
Sourcepub fn parametric_rhs(&self, delta_p: &[f64], out: &mut [f64]) -> bool
pub fn parametric_rhs(&self, delta_p: &[f64], out: &mut [f64]) -> bool
Compute the parametric sensitivity step
Δw = K⁻¹ · Aᵀ · Δp directly, without the Schur factor. This
is the no-bound-check branch of upstream
SensStdStepCalc::Step
(lines 48–83): scatter the parameter perturbation onto the
y_c / x slots picked by a_data, then run one backsolve
against the converged KKT factor.
delta_p has length a_data.nrows(); dx_full has length
backsolver.dim(). Unlike Self::run_sens_step this method
is the right one for the canonical “parametric Δx” use case —
the Schur factor’s only role in sIPOPT’s std flow is the
active-set bound-check refinement after a violating step, and
that refinement is a follow-up (sens_boundcheck = yes).
The right-hand side Self::parametric_step solves against,
without solving it. A release re-solves in a system the
converged factor does not describe, so it needs the right-hand
side rather than the step.
pub fn parametric_step(&self, delta_p: &[f64], dx_full: &mut [f64]) -> bool
Sourcepub fn options(&self) -> &SensOptions
pub fn options(&self) -> &SensOptions
Borrow the resolved option set.
Auto Trait Implementations§
impl<B> Freeze for SensApplication<B>where
B: Freeze,
impl<B> RefUnwindSafe for SensApplication<B>where
B: RefUnwindSafe,
impl<B> Send for SensApplication<B>where
B: Send,
impl<B> Sync for SensApplication<B>where
B: Sync,
impl<B> Unpin for SensApplication<B>where
B: Unpin,
impl<B> UnsafeUnpin for SensApplication<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for SensApplication<B>where
B: UnwindSafe,
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
impl<T, U> Imply<T> for U
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