Adds SVD solver, code refactoring

This commit is contained in:
Volodymyr Orlov
2019-10-16 08:28:36 -07:00
parent 50744208a9
commit f4aec2b35e
9 changed files with 422 additions and 26 deletions
+3 -1
View File
@@ -2,12 +2,14 @@ use std::ops::Range;
pub mod naive;
pub trait Matrix: Into<Vec<f64>>{
pub trait Matrix: Into<Vec<f64>> + Clone{
fn get(&self, row: usize, col: usize) -> f64;
fn qr_solve_mut(&mut self, b: Self) -> Self;
fn svd_solve_mut(&mut self, b: Self) -> Self;
fn zeros(nrows: usize, ncols: usize) -> Self;
fn ones(nrows: usize, ncols: usize) -> Self;