fix: Fix new clippy warnings (#79)

* Fix new clippy warnings

* Allow clippy::suspicious-operation-groupings
This commit is contained in:
Luis Moreno
2021-02-16 18:19:14 -04:00
committed by GitHub
parent 745d0b570e
commit 4af69878e0
5 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
#![allow(clippy::wrong_self_convention)]
//! # Linear Algebra and Matrix Decomposition
//!
//! Most machine learning algorithms in SmartCore depend on linear algebra and matrix decomposition methods from this module.
@@ -265,7 +266,7 @@ pub trait BaseVector<T: RealNumber>: Clone + Debug {
sum += xi * xi;
}
mu /= div;
sum / div - mu * mu
sum / div - mu.powi(2)
}
/// Computes the standard deviation.
fn std(&self) -> T {
+1 -1
View File
@@ -61,7 +61,7 @@ pub trait MatrixStats<T: RealNumber>: BaseMatrix<T> {
sum += a * a;
}
mu /= div;
*x_i = sum / div - mu * mu;
*x_i = sum / div - mu.powi(2);
}
x