/// Compose coefficients array using reflected vector
Compose coefficients array using reflected vector
Compose coefficients array using reflected vector
fn compose_coefficients<S>(&self, a: &ArrayBase<S, Ix1>) -> Coefficients<A>
    where
        S: Data<Elem = A>,
    {
        let k = self.len();
        let res = a.slice(s![k..]).norm_l2();
        let mut c = Array1::zeros(k + 1);
        azip!((c in c.slice_mut(s![..k]), &a in a.slice(s![..k])) *c = a);
        if k < a.len() {
            let ak = a[k];
            c[k] = -ak.mul_real(res / ak.abs());
        } else {
            c[k] = A::from_real(res);
        }
        c
    }
fn compose_coefficients < S > ( & self , a : & ArrayBase < S , Ix1 > ) -> Coefficients < A > where S : Data < Elem = A > , { let k = self . len ( ) ; let res = a . slice ( s ! [ k ] ) . norm_l2 ( ) ; let mut c = Array1 :: zeros ( k + 1 ) ; azip ! ( ( c in c slice_mut ( s [ k ] ) a in a slice ( s [ k ] ) ) c a ) ; if k < a . len ( ) { let ak = a [ k ] ; c [ k ] = - ak . mul_real ( res / ak . abs ( ) ) ; } else { c [ k ] = A :: from_real ( res ) ; } c }
Compose coefficients array using reflected vector
Compose coefficients array using reflected vector
&self
a
&ArrayBase<S, Ix1>