pub fn initial_autocorr(coeffs: &[f64]) -> Vec<Vector2<f64>>Expand description
The initial_autocorr function calculates the initial guesses for Bairstow’s method for finding
roots of a polynomial, specifically for the auto-correlation function.
$$ R = \sqrt[n]{|a_n|},\qquad R \leftarrow \max(R, 1/R),\qquad m = n/2 $$ $$ \theta_k = \frac{k\pi}{m},\qquad (r_k, q_k) = (2R\cos\theta_k,; -R^2) $$
Arguments:
coeffs: Thecoeffsparameter is a slice off64values representing the coefficients of a polynomial. The coefficients are ordered from highest degree to lowest degree.
Returns:
The function initial_autocorr returns a vector of Vec2 structs.
§Examples:
use ginger::rootfinding::initial_autocorr;
use ginger::vector2::Vector2;
let coeffs = vec![10.0, 34.0, 75.0, 94.0, 150.0, 94.0, 75.0, 34.0, 10.0];
let vr0s = initial_autocorr(&coeffs);