pub fn map_block_structure_to_kkt(
cls: &BoundClassification,
var_blocks: &[i32],
con_blocks: &[i32],
) -> Result<Vec<i32>, String>Expand description
Turn a model-space block declaration into the KKT-space labels the block solver takes (structured-KKT Phase 5b’s mapper, plan §63.6).
The KKT is laid out [x | slacks | equality duals | inequality duals], so
each part inherits a label from what it belongs to:
- an
xcolumn takes its variable’s label — skipping variables fixed out byfixed_variable_treatment, which are not in the KKT at all; - a slack and its inequality dual take their constraint’s label;
- an equality dual takes its constraint’s label.
var_blocks / con_blocks are in the model’s own indexing (n_full_x,
n_full_g); negative means shared. Returns the label per KKT index, or an
error naming the mismatch — the caller then falls back rather than
mislabel, because a label that is off by one row silently declares a
structure the matrix does not have.