Skip to content

Optimization

Problem Definitions

Bases: HasDimensions, HasCost, HasBounds, HasEqConstraints, HasIneqConstraints, Protocol

Dense problem: cost + gradient + bounds + dense constraints.

Bases: HasDimensions, HasCost, HasBounds, HasSparseEqConstraints, HasSparseIneqConstraints, Protocol

Sparse problem: cost + gradient + bounds + sparse constraints.

Bases: BaseProblem, HasLagrangianGrad, HasHessian, Protocol

Dense problem with all fields the dense SQP solver may access.

Bases: SparseBaseProblem, HasSparseLagrangianGrad, HasSparseHessian, Protocol

Sparse problem with all fields the sparse SQP solver may access.

Dense

Bases: FunctionBase

Sparse

Sparse version of DenseProblem that uses sparse Jacobians/Hessians.

All sparse matrices are stored in CSC format (indices=row indices, indptr=column pointers). The Hessian returns only the upper-triangular portion as required by PIQP.

lagrangian_hessian_fn cached property

Sparse Lagrangian Hessian (upper triangular, CSC format).

Bases: DenseSQPFunction

Sparse SQP solver using sparse Jacobians/Hessians and PIQP's sparse backend.

Multistage

Bases: _BaseMultistageProblem

Multistage problem with general scalar cost components and exact Hessian.

lagrangian_grad_fn cached property

Block-by-block Lagrangian gradient using VJPs (no Jacobian materialization).

lagrangian_hessian_fn cached property

Sparse Lagrangian Hessian (upper triangular, CSC format).

L(Z, lam) = cost(Z) + lam_eq^T g_eq(Z) + lam_ineq^T g_ineq(Z)

Uses the shared per-block Lagrangian gradient functions from _lagrangian_block_fns, which are also used by lagrangian_grad_fn.

The assembly (sparsity stamping, block offsets, place_blocks kernel) mirrors _MultistageCostFn.build_hessian_fn exactly.

Bases: _BaseMultistageProblem

Multistage problem with NLS cost (0.5*||r(z)||^2) and Gauss-Newton Hessian (J^T J).

cost_hessian_fn cached property

Returns the Gauss-Newton Hessian approximation triu(J^T J).

Solver Settings & Results

Bases: Enum

All values in milliseconds.

Bases: Enum

Bases: Enum