pub fn update_spike_pivot_value(&self, spike: &mut Vec<(usize, F)>) {
        debug_assert!(spike.windows(2).all(|w| w[0].0 < w[1].0));

        let has_pivot_index = spike.binary_search_by_key(&self.pivot, |&(i, _)| i);
        let search_index = match has_pivot_index {
            Ok(index) => index + 1,
            Err(index) => index,
        };

        let difference = self.values.iter()
            .filter_map(|&(j, ref value)| {
                let row = j;
                spike[search_index..]
                    .binary_search_by_key(&row, |&(i, _)| i)
                    .ok()
                    .map(|shift| {
                        value * &spike[search_index + shift].1
                    })
            })
            .sum::<F>();

        update_value(difference, has_pivot_index, self.pivot, spike);
    }
/// Modify the pivot index of the spike.
///
/// During the update, multiples of rows are added to the pivot row in order to make all values
/// except for the right-most one equal to zero. This method computes how that right-most value
/// is affected by that.
Modify the pivot index of the spike.
During the update, multiples of rows are added to the pivot row in order to make all values
except for the right-most one equal to zero. This method computes how that right-most value
is affected by that.
Modify the pivot index of the spike . During the update multiples of rows are added to the pivot row in order to make all values except for the right - most one equal to zero . This method computes how that right - most value is affected by that .
pub fn update_spike_pivot_value(&self, spike: &mut Vec<(usize, F)>) {
        debug_assert!(spike.windows(2).all(|w| w[0].0 < w[1].0));
        let has_pivot_index = spike.binary_search_by_key(&self.pivot, |&(i, _)| i);
        let search_index = match has_pivot_index {
            Ok(index) => index + 1,
            Err(index) => index,
        };
        let difference = self.values.iter()
            .filter_map(|&(j, ref value)| {
                let row = j;
                spike[search_index..]
                    .binary_search_by_key(&row, |&(i, _)| i)
                    .ok()
                    .map(|shift| {
                        value * &spike[search_index + shift].1
                    })
            })
            .sum::<F>();
        update_value(difference, has_pivot_index, self.pivot, spike);
    }
pub fn update_spike_pivot_value ( & self , spike : & mut Vec < ( usize , F ) > ) { debug_assert ! ( spike windows ( 2 ) all ( w w [ 0 ] 0 w [ 1 ] 0 ) ) ; let has_pivot_index = spike . binary_search_by_key ( & self . pivot , | & ( i , _ ) | i ) ; let search_index = match has_pivot_index { Ok ( index ) => index + 1 , Err ( index ) => index , } ; let difference = self . values . iter ( ) . filter_map ( | & ( j , ref value ) | { let row = j ; spike [ search_index .. ] . binary_search_by_key ( & row , | & ( i , _ ) | i ) . ok ( ) . map ( | shift | { value * & spike [ search_index + shift ] . 1 } ) } ) . sum :: < F > ( ) ; update_value ( difference , has_pivot_index , self . pivot , spike ) ; }
Modify the pivot index of the spike.
Modify the pivot index of the spike .
&self
spike
&mut Vec<(usize, F)>
&self
spike
&mut Vec<(usize, F)>