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

Method rm_column

src/matrix.rs:749–766  ·  view source on GitHub ↗
(&self, pos: usize)

Source from the content-addressed store, hash-verified

747 }
748
749 pub fn rm_column(&self, pos: usize) -> Option<Matrix<T>> {
750
751 if pos >= self.cols() {
752 return None;
753 }
754
755 let mut m = Matrix::<T>::new();
756 if self.cols() == 1 {
757 return Some(m);
758 }
759
760 for r in self.row_iter() {
761 let mut q = r.to_vec();
762 q.remove(pos);
763 m.add_row(&q);
764 }
765 Some(m)
766 }
767
768 pub fn if_then<F>(&self, prd: F, tr: T, fa: T) -> Matrix<T>
769 where F: Fn(&T) -> bool {

Callers 4

mainFunction · 0.80
mainFunction · 0.80
plot_nnFunction · 0.80

Calls 4

colsMethod · 0.80
row_iterMethod · 0.80
add_rowMethod · 0.80
to_vecMethod · 0.45

Tested by

no test coverage detected