Skip to main content

assemble_sparse

Function assemble_sparse 

Source
pub fn assemble_sparse(
    problem: &Problem,
    variables: &HashMap<String, VariableEnum>,
    variable_index_map: &HashMap<String, usize>,
    symbolic_structure: &SymbolicStructure,
) -> LinearizerResult<(Mat<f64>, SparseColMat<usize, f64>)>
Expand description

Assemble residuals and sparse Jacobian from the current variable values.

Evaluates all residual blocks in parallel, collecting per-block Jacobian values in column-major order. Uses the pre-computed symbolic structure to efficiently construct the final SparseColMat.

ยงArguments

  • problem - The optimization problem
  • variables - Current variable values
  • variable_index_map - Maps variable names to their column offset in the Jacobian
  • symbolic_structure - Pre-computed sparsity pattern from build_symbolic_structure()