Skip to content

Commit ff10bb4

Browse files
committed
Fix full-rank case
1 parent 4e84acb commit ff10bb4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/krylov/householder.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use super::*;
22
use crate::{inner::*, norm::*};
3+
use num_traits::Zero;
34

45
/// Iterative orthogonalizer using Householder reflection
56
#[derive(Debug, Clone)]
@@ -47,6 +48,10 @@ impl<A: Scalar + Lapack> Orthogonalizer for Householder<A> {
4748
for k in 0..self.len() {
4849
self.reflect(k, a);
4950
}
51+
if a.len() >= self.len() {
52+
// full rank
53+
return Zero::zero();
54+
}
5055
// residual norm
5156
a.slice(s![self.len()..]).norm_l2()
5257
}

0 commit comments

Comments
 (0)