pub fn extend_to_surjection(
        &mut self,
        start_column: usize,
        end_column: usize,
        extra_column_capacity: usize,
    ) -> Vec<usize> {
        let mut added_pivots = Vec::new();
        let columns = self.columns();

        for (i, &pivot) in self.pivots[start_column..end_column].iter().enumerate() {
            if pivot >= 0 {
                continue;
            }
            let mut new_row =
                FpVector::new_with_capacity(self.prime(), columns, columns + extra_column_capacity);
            new_row.set_entry(i, 1);
            self.vectors.push(new_row);
            added_pivots.push(i);
        }
        added_pivots
    }
/// Given a matrix M in rref, add rows to make the matrix surjective when restricted to the
/// columns between `start_column` and `end_column`. That is, if M = [*|B|*] where B is between
/// columns `start_column` and `end_column`, we want the new B to be surjective. This doesn't
/// change the size of the matrix. Rather, it adds the new row to the next empty row in the
/// matrix. This will panic if there are not enough empty rows.
///
/// The rows added are all zero except in a single column, where it is 1. The function returns
/// the list of such columns.
///
/// # Arguments
///  * `first_empty_row` - The first row in the matrix that is empty. This is where we will add
///  our new rows. This is a mutable borrow and by the end of the function, `first_empty_row`
///  will be updated to the new first empty row.
///  * `current_pivots` - The current pivots of the matrix.
///
/// # Panics
/// The function panics if there are not enough empty rows.
Given a matrix M in rref, add rows to make the matrix surjective when restricted to the
columns between `start_column` and `end_column`. That is, if M = [*|B|*] where B is between
columns `start_column` and `end_column`, we want the new B to be surjective. This doesn't
change the size of the matrix. Rather, it adds the new row to the next empty row in the
matrix. This will panic if there are not enough empty rows.

The rows added are all zero except in a single column, where it is 1. The function returns
the list of such columns.
Given a matrix M in rref add rows to make the matrix surjective when restricted to the columns between ` start_column ` and ` end_column ` . That is if M = [ * |B| * ] where B is between columns ` start_column ` and ` end_column ` we want the new B to be surjective . This doesn ' t change the size of the matrix . Rather it adds the new row to the next empty row in the matrix . This will panic if there are not enough empty rows . The rows added are all zero except in a single column where it is 1 . The function returns the list of such columns .
pub fn extend_to_surjection(
        &mut self,
        start_column: usize,
        end_column: usize,
        extra_column_capacity: usize,
    ) -> Vec<usize> {
        let mut added_pivots = Vec::new();
        let columns = self.columns();
        for (i, &pivot) in self.pivots[start_column..end_column].iter().enumerate() {
            if pivot >= 0 {
                continue;
            }
            let mut new_row =
                FpVector::new_with_capacity(self.prime(), columns, columns + extra_column_capacity);
            new_row.set_entry(i, 1);
            self.vectors.push(new_row);
            added_pivots.push(i);
        }
        added_pivots
    }
pub fn extend_to_surjection ( & mut self , start_column : usize , end_column : usize , extra_column_capacity : usize , ) -> Vec < usize > { let mut added_pivots = Vec :: new ( ) ; let columns = self . columns ( ) ; for ( i , & pivot ) in self . pivots [ start_column .. end_column ] . iter ( ) . enumerate ( ) { if pivot >= 0 { continue ; } let mut new_row = FpVector :: new_with_capacity ( self . prime ( ) , columns , columns + extra_column_capacity ) ; new_row . set_entry ( i , 1 ) ; self . vectors . push ( new_row ) ; added_pivots . push ( i ) ; } added_pivots }
Given a matrix M in rref, add rows to make the matrix surjective when restricted to the
columns between `start_column` and `end_column`.
Given a matrix M in rref add rows to make the matrix surjective when restricted to the columns between ` start_column ` and ` end_column ` .
&mut self
start_column
usize
end_column
usize
extra_column_capacity
usize
&mut self
start_column
usize
end_column
usize
extra_column_capacity
usize
panics
The function panics if there are not enough empty rows.
The function panics if there are not enough empty rows .