Skip to main content

SqpQpData

Struct SqpQpData 

Source
pub struct SqpQpData {
    pub n: usize,
    pub m: usize,
    pub h: SymTMatrix,
    pub g: Vec<Number>,
    pub a: GenTMatrix,
    pub bl: Vec<Number>,
    pub bu: Vec<Number>,
    pub xl: Vec<Number>,
    pub xu: Vec<Number>,
    pub hessian_inertia: HessianInertia,
    pub hess_inf: Number,
    /* private fields */
}
Expand description

Owned linearization data for a single SQP iteration.

n / m are always the NLP’s dimensions and a its Jacobian. When the subproblem is lifted (Self::build_low_rank) the QP the solver sees is larger: h, g, bl, bu, xl, xu hold the lifted problem’s data (lengths n + r, m + r), its first n / m entries being the unlifted ones, and the lifted constraint matrix lives in the private lift.

Fields§

§n: usize§m: usize§h: SymTMatrix§g: Vec<Number>§a: GenTMatrix§bl: Vec<Number>§bu: Vec<Number>§xl: Vec<Number>§xu: Vec<Number>§hessian_inertia: HessianInertia§hess_inf: Number

max |∇²L_ij| of the Hessian the step is computed against — the dense one, not the lifted diagonal, so the scale-relative QP tolerances do not depend on whether the QP was lifted.

Implementations§

Source§

impl SqpQpData

Source

pub fn build( x: &[Number], grad_f: &[Number], c_vals: &[Number], bl_c: &[Number], bu_c: &[Number], xl_orig: &[Number], xu_orig: &[Number], jac_c: Triplet, hess_lag: Triplet, hessian_inertia: HessianInertia, ) -> Self

Assemble from concrete linearization arrays at iterate x.

  • grad_f — ∇f(x), length n.
  • c_vals — c(x), length m (may contain inequality slack values too; convention is bl_c[i] ≤ c[i] ≤ bu_c[i]).
  • bl_c, bu_c — original NLP constraint bounds.
  • xl_orig, xu_orig — original NLP variable bounds.
  • jac_c — ∇c(x) triplet, m × n.
  • hess_lag — ∇²L(x, λ_g) triplet, n × n symmetric.
Source

pub fn build_low_rank( x: &[Number], grad_f: &[Number], c_vals: &[Number], bl_c: &[Number], bu_c: &[Number], xl_orig: &[Number], xu_orig: &[Number], jac_c: Triplet, b: &LowRankHessian, ) -> Self

Assemble the subproblem for a low-rank Hessian B = σI + Σ ±vvᵀ without forming B — see the module docs. Same arguments as Self::build otherwise.

Source

pub fn as_qp(&self) -> QpProblem<'_>

Borrowed QpProblem view ready for pounce_qp::QpSolver::solve.

Source

pub fn as_qp_with_row_bounds<'a>( &'a self, bl: &'a [Number], bu: &'a [Number], ) -> QpProblem<'a>

Self::as_qp with replacement general-row bounds (the second-order correction re-centres them). bl / bu must have Self::bl’s length, lifted rows included.

Source

pub fn is_lifted(&self) -> bool

Whether the QP the solver sees is lifted.

Source

pub fn lift_working_set(&self, w: &WorkingSet) -> WorkingSet

A working set in the NLP’s dimensions, extended for the lifted QP: the lifted rows are equalities, the lifted variables free.

Source

pub fn unlift_solution(&self, sol: QpSolution) -> QpSolution

A QP solution back in the NLP’s dimensions: the lifted variables’ values and the lifted rows’ multipliers are dropped. Exact, not an approximation: the lifted rows only define w, so the step p and the multipliers of the original rows and bounds are those of the unlifted QP.

Auto Trait Implementations§

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