Skip to content

Workspace

class Workspace

Contains all elements computed during each solver iteration, including current solution estimates, KKT residual terms and hessians, and Newton step

The workspace is initialized in Solver::set_problem() after the problem dimensions are known, and is updated during each iteration of the solver, minimizing allocations, though more work needs to be done to fully leverage this.

Variables

Name Description
z Stacked solution vector [z; s_ineq; s_comp; m_eq; m_ineq; m_comp]
s_ineq Primal variables
s_comp Inequality slacks (in the retraction domain)
m_eq Complementarity slacks (in the retraction domain)
m_ineq Equality multipliers
m_comp Inequality multipliers
m_eq_est Complementarity multipliers
m_ineq_est Equality multiplier estimates for AL
m_comp_est Inequality multiplier estimates for AL
kkt_residual Complementarity multiplier estimates for AL
s_ineq_stationarity KKT residual, driven to 0 in each subproblem solve
s_comp_stationarity Inequality stationarity terms
residual_eq Complementarity stationarity terms
residual_ineq Equality constraint residuals
residual_comp Inequality constraint residuals
relax_param Complementarity constraint residuals
penalty_param Relaxation parameter for the retraction map
kkt_system Penalty parameter for the augmented Lagrangian KKT system matrix, stored in sparse format with the structure intended to be fixed after it is initialize by Solver::set_problem.
amd_perm_vec AMD permutation for KKT system, reduces in-fill
amd_iperm_vec AMD permutation for KKT system, reduces in-fill
scaling Inverse AMD permutation for KKT system
newton_step Diagonal scaling for KKT system, improves conditioning (ruiz equilibration)
etree Newton step for the KKT system (possibly computed with regularization)

Functions

Name Description
appendBlockTriplets Inserts a sparse block matrix into a sparse matrix represented as a triplet list given the top right corner of the block and the block matrix] while preserving the sparsity pattern of the original block matrix.
findValuePtrIndex Given a row and column index into kkt_system, find the data index in the underlying kkt_system.valuePtr() array, returning -1 if it doesn't exist. !!! warning This function assumes that the KKT system is in the compressed format row : row index col : col_index

Variable Details

amd_iperm_vec

Eigen::Matrix<QDLDL_int, Eigen::Dynamic, 1> amd_iperm_vec

AMD permutation for KKT system, reduces in-fill

amd_perm_vec

Eigen::Matrix<QDLDL_int, Eigen::Dynamic, 1> amd_perm_vec

AMD permutation for KKT system, reduces in-fill

etree

Eigen::Matrix<QDLDL_int, Eigen::Dynamic, 1> etree

Newton step for the KKT system (possibly computed with regularization)

kkt_residual

Vec kkt_residual

Complementarity multiplier estimates for AL

kkt_system

SMat kkt_system

Penalty parameter for the augmented Lagrangian KKT system matrix, stored in sparse format with the structure intended to be fixed after it is initialize by Solver::set_problem.

m_comp

Eigen::Map<Vec> m_comp

Inequality multipliers

m_comp_est

Vec m_comp_est

Inequality multiplier estimates for AL

m_eq

Eigen::Map<Vec> m_eq

Complementarity slacks (in the retraction domain)

m_eq_est

Vec m_eq_est

Complementarity multipliers

m_ineq

Eigen::Map<Vec> m_ineq

Equality multipliers

m_ineq_est

Vec m_ineq_est

Equality multiplier estimates for AL

newton_step

Vec newton_step

Diagonal scaling for KKT system, improves conditioning (ruiz equilibration)

penalty_param

double penalty_param

Relaxation parameter for the retraction map

relax_param

double relax_param

Complementarity constraint residuals

residual_comp

Vec residual_comp

Inequality constraint residuals

residual_eq

Vec residual_eq

Complementarity stationarity terms

residual_ineq

Vec residual_ineq

Equality constraint residuals

s_comp

Eigen::Map<Vec> s_comp

Inequality slacks (in the retraction domain)

s_comp_stationarity

Vec s_comp_stationarity

Inequality stationarity terms

s_ineq

Eigen::Map<Vec> s_ineq

Primal variables

s_ineq_stationarity

Vec s_ineq_stationarity

KKT residual, driven to 0 in each subproblem solve

scaling

Vec scaling

Inverse AMD permutation for KKT system

z

Eigen::Map<Vec> z

Stacked solution vector [z; s_ineq; s_comp; m_eq; m_ineq; m_comp]

Function Details

appendBlockTriplets

void appendBlockTriplets(std::vector<Eigen::Triplet<double>>& triplets, const SMat& block, int row_start, int col_start)

Inserts a sparse block matrix into a sparse matrix represented as a triplet list given the top right corner of the block and the block matrix] while preserving the sparsity pattern of the original block matrix.

Warning

This function does not check whether the elements being inserted already exist in the triplet list.

triplets : the triplet list representing the sparse matrix to be modified

block : the block matrix to be inserted

row_start : the starting row index of the block in the sparse matrix

col_start : the starting column index of the block in the sparse matrix

findValuePtrIndex

int findValuePtrIndex(int row, int col)

Given a row and column index into kkt_system, find the data index in the underlying kkt_system.valuePtr() array, returning -1 if it doesn't exist.

Warning

This function assumes that the KKT system is in the compressed format

row : row index

col : col_index