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: Numbermax |∇²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
impl SqpQpData
Sourcepub 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
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), lengthn.c_vals—c(x), lengthm(may contain inequality slack values too; convention isbl_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 × nsymmetric.
Sourcepub 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
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.
Sourcepub fn as_qp(&self) -> QpProblem<'_>
pub fn as_qp(&self) -> QpProblem<'_>
Borrowed QpProblem view ready for
pounce_qp::QpSolver::solve.
Sourcepub fn as_qp_with_row_bounds<'a>(
&'a self,
bl: &'a [Number],
bu: &'a [Number],
) -> QpProblem<'a>
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.
Sourcepub fn lift_working_set(&self, w: &WorkingSet) -> WorkingSet
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.
Sourcepub fn unlift_solution(&self, sol: QpSolution) -> QpSolution
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§
impl !Freeze for SqpQpData
impl !RefUnwindSafe for SqpQpData
impl !Send for SqpQpData
impl !Sync for SqpQpData
impl Unpin for SqpQpData
impl UnsafeUnpin for SqpQpData
impl UnwindSafe for SqpQpData
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