/// Extend the matrix in place by adding one full row. An error
/// is returned if the row does not have the expected number of
/// elements or if an empty row is passed.
Extend the matrix in place by adding one full row. An error
is returned if the row does not have the expected number of
elements or if an empty row is passed.
Extend the matrix in place by adding one full row . An error is returned if the row does not have the expected number of elements or if an empty row is passed .
pub fn extend(&mut self, row: &[C]) -> Result<(), MatrixFormatError> {
        if row.is_empty() {
            return Err(MatrixFormatError(
                "adding an empty row is not allowed".to_owned(),
            ));
        }
        if self.columns != row.len() {
            return Err(MatrixFormatError(format!(
                "new row has {} columns intead of expected {}",
                row.len(),
                self.columns
            )));
        }
        self.rows += 1;
        for e in row {
            self.data.push(e.clone());
        }
        Ok(())
    }
pub fn extend ( & mut self , row : & [ C ] ) -> Result < ( ) , MatrixFormatError > { if row . is_empty ( ) { return Err ( MatrixFormatError ( " " . to_owned ( ) , ) ) ; } if self . columns != row . len ( ) { return Err ( MatrixFormatError ( format ! ( " " row len ( ) self columns ) ) ) ; } self . rows += 1 ; for e in row { self . data . push ( e . clone ( ) ) ; } Ok ( ( ) ) }
Extend the matrix in place by adding one full row.
Extend the matrix in place by adding one full row .
&mut self
row
&[C]