fn extract_head_columns( matrix: &[f64], rows: usize, total_cols: usize, head_idx: usize, head_cols: usize, ) -> Vec<f64>
Extract one head slice from a row-major matrix.