fn update_b(
        &mut self,
        pivot_row_index: usize,
        column: &SparseVector<F, F>,
    ) {
        debug_assert!(pivot_row_index < self.m());
        debug_assert_eq!(Vector::len(column), self.m());

        let pivot_value = column.get(pivot_row_index)
            .expect("Pivot value can't be zero.");

        // First normalize the pivot index
        self.b[pivot_row_index] /= pivot_value;

        // Then add multiples of the resulting value to the other values
        // TODO(ARCHITECTURE): Is there a nicer way to go about this?
        let (b_left, b_right) = self.b.data.split_at_mut(pivot_row_index);
        let (b_middle, b_right) = b_right.split_first_mut().unwrap();

        for (edit_row_index, column_value) in column.iter_values() {
            match edit_row_index.cmp(&pivot_row_index) {
                Ordering::Less => {
                    b_left[*edit_row_index] -= column_value * &*b_middle;
                },
                Ordering::Equal => {},
                Ordering::Greater => {
                    b_right[*edit_row_index - (pivot_row_index + 1)] -= column_value * &*b_middle;
                }
            }
        }
    }
/// Normalize the pivot row and row reduce the other basis inverse rows.
///
/// # Arguments
///
/// * `pivot_row_index`: Index of the pivot row.
/// * `column`: Column relative to the current basis to be entered into that basis.
///
/// # Note
///
/// This method requires a normalized pivot element.
Normalize the pivot row and row reduce the other basis inverse rows.
Normalize the pivot row and row reduce the other basis inverse rows .
fn update_b(
        &mut self,
        pivot_row_index: usize,
        column: &SparseVector<F, F>,
    ) {
        debug_assert!(pivot_row_index < self.m());
        debug_assert_eq!(Vector::len(column), self.m());
        let pivot_value = column.get(pivot_row_index)
            .expect("Pivot value can't be zero.");
        // First normalize the pivot index
        self.b[pivot_row_index] /= pivot_value;
        // Then add multiples of the resulting value to the other values
        // TODO(ARCHITECTURE): Is there a nicer way to go about this?
        let (b_left, b_right) = self.b.data.split_at_mut(pivot_row_index);
        let (b_middle, b_right) = b_right.split_first_mut().unwrap();
        for (edit_row_index, column_value) in column.iter_values() {
            match edit_row_index.cmp(&pivot_row_index) {
                Ordering::Less => {
                    b_left[*edit_row_index] -= column_value * &*b_middle;
                },
                Ordering::Equal => {},
                Ordering::Greater => {
                    b_right[*edit_row_index - (pivot_row_index + 1)] -= column_value * &*b_middle;
                }
            }
        }
    }
fn update_b ( & mut self , pivot_row_index : usize , column : & SparseVector < F , F > , ) { debug_assert ! ( pivot_row_index self m ( ) ) ; debug_assert_eq ! ( Vector len ( column ) self m ( ) ) ; let pivot_value = column . get ( pivot_row_index ) . expect ( " " ) ; // First normalize the pivot index self . b [ pivot_row_index ] /= pivot_value ; // Then add multiples of the resulting value to the other values // TODO(ARCHITECTURE): Is there a nicer way to go about this? let ( b_left , b_right ) = self . b . data . split_at_mut ( pivot_row_index ) ; let ( b_middle , b_right ) = b_right . split_first_mut ( ) . unwrap ( ) ; for ( edit_row_index , column_value ) in column . iter_values ( ) { match edit_row_index . cmp ( & pivot_row_index ) { Ordering :: Less => { b_left [ * edit_row_index ] -= column_value * & * b_middle ; } , Ordering :: Equal => { } , Ordering :: Greater => { b_right [ * edit_row_index - ( pivot_row_index + 1 ) ] -= column_value * & * b_middle ; } } } }
Normalize the pivot row and row reduce the other basis inverse rows.
Normalize the pivot row and row reduce the other basis inverse rows .
&mut self
pivot_row_index
usize
column
&SparseVector<F, F>
&mut self
pivot_row_index
usize
column
&SparseVector<F, F>
note
This method requires a normalized pivot element.
This method requires a normalized pivot element .