fix: more refactoring

This commit is contained in:
Volodymyr Orlov
2020-03-13 11:24:53 -07:00
parent cb4323f26e
commit 4f8318e933
15 changed files with 51 additions and 66 deletions
+1 -11
View File
@@ -366,12 +366,7 @@ impl BaseMatrix for DenseMatrix {
fn sub_element_mut(&mut self, row: usize, col: usize, x: f64) {
self.values[col*self.nrows + row] -= x;
}
fn generate_positive_definite(nrows: usize, ncols: usize) -> Self {
let m = DenseMatrix::rand(nrows, ncols);
m.dot(&m.transpose())
}
}
fn transpose(&self) -> Self {
let mut m = DenseMatrix {
@@ -723,11 +718,6 @@ mod tests {
}
}
#[test]
fn generate_positive_definite() {
let m = DenseMatrix::generate_positive_definite(3, 3);
}
#[test]
fn reshape() {
let m_orig = DenseMatrix::vector_from_array(&[1., 2., 3., 4., 5., 6.]);