suppress

Function suppress 

Source
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 parameter vA1 is a Vector2 object representing a vector with two components. It is used as an input parameter in the suppress function.
  • vri: The parameter vri represents the vector ri, and vrj represents the vector rj. These vectors are used in the calculation of the suppression step in the Bairstow’s method for root finding.
  • vrj: The parameter vrj represents 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);