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 6186cb5 commit 0f0eb5eCopy full SHA for 0f0eb5e
lax/src/tridiagonal.rs
@@ -30,11 +30,10 @@ pub struct Tridiagonal<A: Scalar> {
30
31
impl<A: Scalar> Tridiagonal<A> {
32
fn opnorm_one(&self) -> A::Real {
33
- let n = self.l.len() as usize;
34
let mut col_sum: Vec<A::Real> = self.d.iter().map(|val| val.abs()).collect();
35
- for i in 0..n - 1 {
36
- if i < n - 1 {
37
- col_sum[i] += self.dl[i + 1].abs();
+ for i in 0..col_sum.len() {
+ if i < self.dl.len() {
+ col_sum[i] += self.dl[i].abs();
38
}
39
if i > 0 {
40
col_sum[i] += self.du[i - 1].abs();
0 commit comments