From 0b0f248267e3822fe40878e783e49de636c0eac7 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 11 Oct 2020 11:23:05 +0200 Subject: [PATCH] clippy: fix #identity_op --- src/base/blas.rs | 4 ++-- src/linalg/schur.rs | 8 ++++---- src/linalg/svd.rs | 6 +++--- src/linalg/symmetric_eigen.rs | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/base/blas.rs b/src/base/blas.rs index 1d61b9d2..c0615066 100644 --- a/src/base/blas.rs +++ b/src/base/blas.rs @@ -363,8 +363,8 @@ where while self.nrows() - i >= 8 { acc0 += unsafe { - conjugate(self.get_unchecked((i + 0, j)).inlined_clone()) - * rhs.get_unchecked((i + 0, j)).inlined_clone() + conjugate(self.get_unchecked((i, j)).inlined_clone()) + * rhs.get_unchecked((i, j)).inlined_clone() }; acc1 += unsafe { conjugate(self.get_unchecked((i + 1, j)).inlined_clone()) diff --git a/src/linalg/schur.rs b/src/linalg/schur.rs index acdcd3dd..8d8be72d 100644 --- a/src/linalg/schur.rs +++ b/src/linalg/schur.rs @@ -136,9 +136,9 @@ where let m = end - 1; let n = end; - let h11 = t[(start + 0, start + 0)]; - let h12 = t[(start + 0, start + 1)]; - let h21 = t[(start + 1, start + 0)]; + let h11 = t[(start, start)]; + let h12 = t[(start, start + 1)]; + let h21 = t[(start + 1, start)]; let h22 = t[(start + 1, start + 1)]; let h32 = t[(start + 2, start + 1)]; @@ -161,7 +161,7 @@ where if not_zero { if k > start { - t[(k + 0, k - 1)] = norm; + t[(k, k - 1)] = norm; t[(k + 1, k - 1)] = N::zero(); t[(k + 2, k - 1)] = N::zero(); } diff --git a/src/linalg/svd.rs b/src/linalg/svd.rs index 4be0ecdb..94ec4d96 100644 --- a/src/linalg/svd.rs +++ b/src/linalg/svd.rs @@ -218,9 +218,9 @@ where } } - diagonal[k + 0] = subm[(0, 0)]; + diagonal[k] = subm[(0, 0)]; diagonal[k + 1] = subm[(1, 1)]; - off_diagonal[k + 0] = subm[(0, 1)]; + off_diagonal[k] = subm[(0, 1)]; if k != n - 1 { off_diagonal[k + 1] = subm[(1, 2)]; @@ -244,7 +244,7 @@ where let u2 = u2.map(|u2| GivensRotation::new_unchecked(u2.c(), N::from_real(u2.s()))); let v2 = v2.map(|v2| GivensRotation::new_unchecked(v2.c(), N::from_real(v2.s()))); - diagonal[start + 0] = s[0]; + diagonal[start] = s[0]; diagonal[start + 1] = s[1]; off_diagonal[start] = N::RealField::zero(); diff --git a/src/linalg/symmetric_eigen.rs b/src/linalg/symmetric_eigen.rs index 70f57cdf..2d62816e 100644 --- a/src/linalg/symmetric_eigen.rs +++ b/src/linalg/symmetric_eigen.rs @@ -192,7 +192,7 @@ where let eigvals = m.eigenvalues().unwrap(); let basis = Vector2::new(eigvals.x - diag[start + 1], off_diag[start]); - diag[start + 0] = eigvals[0]; + diag[start] = eigvals[0]; diag[start + 1] = eigvals[1]; if let Some(ref mut q) = q {