pub fn compute_area(data: &Vec<f64>, current_peak: &mut GraphPeak) {
    current_peak.area = 0.0;
    
    if current_peak.left_trough.x < current_peak.right_trough.x {
        for index in current_peak.left_trough.x + 1..current_peak.right_trough.x + 1 {
            let b = data[index] + data[index - 1];
            current_peak.area += 0.5 * b;
        }
    }
}
// Computes the area of the given peak.
Computes the area of the given peak.
Computes the area of the given peak .
pub fn compute_area(data: &Vec<f64>, current_peak: &mut GraphPeak) {
    current_peak.area = 0.0;
    if current_peak.left_trough.x < current_peak.right_trough.x {
        for index in current_peak.left_trough.x + 1..current_peak.right_trough.x + 1 {
            let b = data[index] + data[index - 1];
            current_peak.area += 0.5 * b;
        }
    }
}
pub fn compute_area ( data : & Vec < f64 > , current_peak : & mut GraphPeak ) { current_peak . area = 0.0 ; if current_peak . left_trough . x < current_peak . right_trough . x { for index in current_peak . left_trough . x + 1 .. current_peak . right_trough . x + 1 { let b = data [ index ] + data [ index - 1 ] ; current_peak . area += 0.5 * b ; } } }
Computes the area of the given peak.
Computes the area of the given peak .
data
&Vec<f64>
current_peak
&mut GraphPeak