Skip to main content

SensApplication

Struct SensApplication 

Source
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,

Source

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.

Source

pub fn compute_reduced_hessian(&mut self, out: &mut [f64]) -> bool
where B: Clone,

Compute the reduced Hessian into the caller-supplied row-/column-major buffer (column-major in pounce, matching DenseGenSchurDriver). Buffer length must be where n = a_data.nrows(). Mirrors the compute_red_hessian=true branch of upstream SensApplication::Run.

Returns false if the underlying schur computation fails.

Source

pub fn compute_reduced_hessian_eigen( &mut self, hr_out: &mut [f64], eigvals_out: &mut [f64], eigvecs_out: &mut [f64], ) -> bool
where B: Clone,

Compute the reduced Hessian and its symmetric eigendecomposition in one pass. hr_out is the column-major Hessian buffer (same shape as Self::compute_reduced_hessian); eigvals_out receives the n eigenvalues in ascending order; eigvecs_out receives the 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).

Source

pub fn run_sens_step( &mut self, b_data: &IndexSchurData, rhs_u: &[f64], du: &mut [f64], dx_full: &mut [f64], ) -> bool
where 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.

Source

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.

Source

pub fn parametric_step(&self, delta_p: &[f64], dx_full: &mut [f64]) -> bool

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more