MCPcopy Create free account
hub / github.com/daniel-e/rustml / add_row

Method add_row

src/matrix.rs:669–682  ·  view source on GitHub ↗
(&mut self, row: &[T])

Source from the content-addressed store, hash-verified

667 }
668
669 pub fn add_row(&mut self, row: &[T]) {
670
671 if self.rows() == 0 {
672 self.ncols = row.len();
673 } else {
674 if self.cols() != row.len() {
675 panic!("Invalid dimension.");
676 }
677 }
678 self.nrows += 1;
679 for i in row {
680 self.data.push(i.clone());
681 }
682 }
683
684 /// Extends the current matrix by putting the matrix `m` below it.
685 pub fn push_matrix_below(&self, m: &Matrix<T>) -> Option<Matrix<T>> {

Callers 9

test_matrix_vector_opsFunction · 0.80
matrixMethod · 0.80
as_matrixMethod · 0.80
from_row_vectorsMethod · 0.80
from_fileMethod · 0.80
insert_columnMethod · 0.80
rm_columnMethod · 0.80
test_add_rowFunction · 0.80

Calls 3

rowsMethod · 0.80
colsMethod · 0.80
lenMethod · 0.45

Tested by 2

test_matrix_vector_opsFunction · 0.64
test_add_rowFunction · 0.64