fn assert_result<D1: Data<Elem = f64>, D2: Data<Elem = f64>>(
        a: &ArrayBase<D1, Ix2>,
        b: &ArrayBase<D2, Ix1>,
        res: &LeastSquaresResult<f64, Ix1>,
    ) {
        assert_eq!(res.rank, 2);
        let b_hat = a.dot(&res.solution);
        let rssq = (b - &b_hat).mapv(|x| x.powi(2)).sum();
        assert!(res.residual_sum_of_squares.as_ref().unwrap()[()].abs_diff_eq(&rssq, 1e-12));
        assert!(res
            .solution
            .abs_diff_eq(&array![-0.428571428571429, 0.85714285714285], 1e-12));
    }
//
// Test that the different least squares traits work as intended on the
// different array types.
//
//               | least_squares | ls_into | ls_in_place |
// --------------+---------------+---------+-------------+
// Array         | yes           | yes     | yes         |
// ArcArray      | yes           | no      | no          |
// CowArray      | yes           | yes     | yes         |
// ArrayView     | yes           | no      | no          |
// ArrayViewMut  | yes           | no      | yes         |
//
Test that the different least squares traits work as intended on the
different array types.


Test that the different least squares traits work as intended on the different array types .
fn assert_result<D1: Data<Elem = f64>, D2: Data<Elem = f64>>(
        a: &ArrayBase<D1, Ix2>,
        b: &ArrayBase<D2, Ix1>,
        res: &LeastSquaresResult<f64, Ix1>,
    ) {
        assert_eq!(res.rank, 2);
        let b_hat = a.dot(&res.solution);
        let rssq = (b - &b_hat).mapv(|x| x.powi(2)).sum();
        assert!(res.residual_sum_of_squares.as_ref().unwrap()[()].abs_diff_eq(&rssq, 1e-12));
        assert!(res
            .solution
            .abs_diff_eq(&array![-0.428571428571429, 0.85714285714285], 1e-12));
    }
fn assert_result < D1 : Data < Elem = f64 > , D2 : Data < Elem = f64 > > ( a : & ArrayBase < D1 , Ix2 > , b : & ArrayBase < D2 , Ix1 > , res : & LeastSquaresResult < f64 , Ix1 > , ) { assert_eq ! ( res rank 2 ) ; let b_hat = a . dot ( & res . solution ) ; let rssq = ( b - & b_hat ) . mapv ( | x | x . powi ( 2 ) ) . sum ( ) ; assert ! ( res residual_sum_of_squares as_ref ( ) unwrap ( ) [ ( ) ] abs_diff_eq ( rssq 1e-12 ) ) ; assert ! ( res solution abs_diff_eq ( array [ 0.428571428571429 0.85714285714285 ] 1e-12 ) ) ; }
Test that the different least squares traits work as intended on the
different array types.
Test that the different least squares traits work as intended on the different array types .
a
&ArrayBase<D1, Ix2>
b
&ArrayBase<D2, Ix1>
res
&LeastSquaresResult<f64, Ix1>
a
&ArrayBase<D1, Ix2>
b
&ArrayBase<D2, Ix1>
res
&LeastSquaresResult<f64, Ix1>