-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from wgurecky/faer_0190
Update to faer 0.19.0
- Loading branch information
Showing
17 changed files
with
124 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,2 @@ | ||
// root level lib | ||
use faer::{prelude::*}; | ||
use faer_core::{mat, Mat, MatRef}; | ||
|
||
// other modules | ||
pub mod lib_math_utils; | ||
pub mod lib_math_utils_py; | ||
|
||
// example root level routines in the lib | ||
pub fn my_add(left: usize, right: usize) -> usize { | ||
left + right | ||
} | ||
|
||
|
||
pub fn svd_random_faer<'a>(my_mat: Mat<f64>) -> (Mat<f64>, Mat<f64>, Mat<f64>) { | ||
print!("test"); | ||
print!("test2"); | ||
let my_svd = my_mat.svd(); | ||
(my_svd.u().to_owned(), my_svd.s_diagonal().to_owned(), my_svd.v().to_owned()) | ||
} | ||
|
||
|
||
// example simple within-lib test | ||
#[cfg(test)] | ||
mod lib_unit_tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = my_add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
|
||
#[test] | ||
fn tst_svd(){ | ||
let a = mat![ | ||
[1., 2.], | ||
[3., 4.], | ||
]; | ||
// multiple assignment with types | ||
let (b, c, d): (Mat<f64>,Mat<f64>,Mat<f64>) = svd_random_faer(a); | ||
print!("svd test \n"); | ||
print!("{:?} \n", b); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.