pub fn project_box(
x: &[f64],
lower: &[f64],
upper: &[f64],
) -> Result<Vec<f64>, String>Expand description
Project a point onto a box constraint [lower, upper].
For each component i, returns x[i].clamp(lower[i], upper[i]).
All arrays must have the same length.