Skip to content

Commit 1092554

Browse files
committed
Use inner product
1 parent 199e2d0 commit 1092554

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/arnoldi.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{generate::*, norm::Norm, types::*};
1+
use crate::{generate::*, inner::*, norm::Norm, types::*};
22
use ndarray::*;
33

44
#[derive(Debug, Clone)]
@@ -34,7 +34,7 @@ impl<A: Scalar + Lapack> MGS<A> {
3434
let mut coef = Array1::zeros(self.len() + 1);
3535
for i in 0..self.len() {
3636
let q = &self.q[i];
37-
let c = a.dot(q);
37+
let c = q.inner(&a);
3838
azip!(mut a, q (q) in { *a = *a - c * q } );
3939
coef[i] = c;
4040
}
@@ -108,4 +108,14 @@ mod tests {
108108
fn test_c32() {
109109
test::<c32>(1e-5);
110110
}
111+
112+
#[test]
113+
fn test_f64() {
114+
test::<f64>(1e-9);
115+
}
116+
117+
#[test]
118+
fn test_c64() {
119+
test::<c64>(1e-9);
120+
}
111121
}

0 commit comments

Comments
 (0)