pub fn suppress(
vA: &Vector2<f64>,
vA1: &Vector2<f64>,
vri: &Vector2<f64>,
vrj: &Vector2<f64>,
) -> (Vector2<f64>, Vector2<f64>)Expand description
The suppress function in Rust performs zero suppression on a set of vectors.
Arguments:
vA: A vector representing the coefficients of a polynomial function.vA1: The parametervA1is aVector2object representing a vector with two components. It is used as an input parameter in thesuppressfunction.vri: The parametervrirepresents the vectorri, andvrjrepresents the vectorrj. These vectors are used in the calculation of the suppression step in the Bairstow’s method for root finding.vrj: The parametervrjrepresents a vector with coordinates (4.0, 5.0). Zero suppression
§Examples:
use ginger::rootfinding::delta;
use ginger::rootfinding::suppress;
use ginger::vector2::Vector2;
use approx_eq::assert_approx_eq;
let mut vA = Vector2::new(3.0, 3.0);
let mut vA1 = Vector2::new(1.0, 2.0);
let vri = Vector2::new(-2.0, 0.0);
let vrj = Vector2::new(4.0, 5.0);
(vA, vA1) = suppress(&mut vA, &mut vA1, &vri, &vrj);
let dr = delta(&vA, &vri, &vA1);
assert_approx_eq!(dr.x_, -16.780821917808325);
assert_approx_eq!(dr.y_, 1.4383561643835612);