Skip to main content

clarabel_to_copp2_solution

Function clarabel_to_copp2_solution 

Source
pub fn clarabel_to_copp2_solution(
    s_len: usize,
    solution: &DefaultSolution<f64>,
) -> Vec<f64>
Expand description

Extract a nonnegative a profile from Clarabel solution vector with minimal copying.

  • s_len is expected to be problem.s_len() (problem: Topp2Problem or Copp2Problem);
  • values are copied from solution.x[..min(s_len, solution.x.len())];
  • missing tail is zero-filled;
  • all entries are clamped to >= 0.

This helper intentionally does not decide status acceptance; pair it with ClarabelOptions::is_allow(...) in caller logic.