We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 003be74 commit 50c6d3fCopy full SHA for 50c6d3f
examples/solve.rs
@@ -0,0 +1,21 @@
1
+
2
+extern crate ndarray;
3
+extern crate ndarray_linalg;
4
5
+use ndarray::*;
6
+use ndarray_linalg::*;
7
8
+// Solve `Ax=b` for many b with fixed A
9
+fn factorize() -> Result<(), error::LinalgError> {
10
+ let a: Array2<f64> = random((3, 3));
11
+ let f = a.factorize_into()?; // LU factorize A (A is consumed)
12
+ for _ in 0..10 {
13
+ let b: Array1<f64> = random(3);
14
+ let x = f.solve(Transpose::No, b)?; // solve Ax=b using factorized L, U
15
+ }
16
+ Ok(())
17
+}
18
19
+fn main() {
20
+ factorize().unwrap();
21
0 commit comments