Fix clippy::comparison_chain

This commit is contained in:
Luis Moreno
2020-11-09 00:02:22 -04:00
parent 3c1969bdf5
commit 5e887634db
3 changed files with 41 additions and 40 deletions
+5 -6
View File
@@ -33,6 +33,7 @@
//! <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
#![allow(non_snake_case)]
use std::cmp::Ordering;
use std::fmt::Debug;
use std::marker::PhantomData;
@@ -78,12 +79,10 @@ impl<T: RealNumber, M: BaseMatrix<T>> LU<T, M> {
for i in 0..n_rows {
for j in 0..n_cols {
if i > j {
L.set(i, j, self.LU.get(i, j));
} else if i == j {
L.set(i, j, T::one());
} else {
L.set(i, j, T::zero());
match i.cmp(&j) {
Ordering::Greater => L.set(i, j, self.LU.get(i, j)),
Ordering::Equal => L.set(i, j, T::one()),
Ordering::Less => L.set(i, j, T::zero()),
}
}
}