more clippy fixes
This commit is contained in:
@@ -212,7 +212,7 @@ mod tests_fastpair {
|
|||||||
use crate::linalg::basic::{arrays::Array, matrix::DenseMatrix};
|
use crate::linalg::basic::{arrays::Array, matrix::DenseMatrix};
|
||||||
|
|
||||||
/// Brute force algorithm, used only for comparison and testing
|
/// Brute force algorithm, used only for comparison and testing
|
||||||
pub fn closest_pair_brute(fastpair: &FastPair<f64, DenseMatrix<f64>>) -> PairwiseDistance<f64> {
|
pub fn closest_pair_brute(fastpair: &FastPair<'_, f64, DenseMatrix<f64>>) -> PairwiseDistance<f64> {
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
let m = fastpair.samples.shape().0;
|
let m = fastpair.samples.shape().0;
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ impl<'a, T: Debug + Display + Copy + Sized> DenseMatrixMutView<'a, T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn iter_mut<'b>(&'b mut self, axis: u8) -> Box<dyn Iterator<Item = &mut T> + 'b> {
|
fn iter_mut<'b>(&'b mut self, axis: u8) -> Box<dyn Iterator<Item = &'b mut T> + 'b> {
|
||||||
let column_major = self.column_major;
|
let column_major = self.column_major;
|
||||||
let stride = self.stride;
|
let stride = self.stride;
|
||||||
let ptr = self.values.as_mut_ptr();
|
let ptr = self.values.as_mut_ptr();
|
||||||
@@ -604,6 +604,7 @@ impl<T: RealNumber> MatrixStats<T> for DenseMatrix<T> {}
|
|||||||
impl<T: RealNumber> MatrixPreprocessing<T> for DenseMatrix<T> {}
|
impl<T: RealNumber> MatrixPreprocessing<T> for DenseMatrix<T> {}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[warn(clippy::reversed_empty_ranges)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use approx::relative_eq;
|
use approx::relative_eq;
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ pub trait MatrixPreprocessing<T: RealNumber>: MutArrayView2<T> + Clone {
|
|||||||
///
|
///
|
||||||
/// assert_eq!(a, expected);
|
/// assert_eq!(a, expected);
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
fn binarize_mut(&mut self, threshold: T) {
|
fn binarize_mut(&mut self, threshold: T) {
|
||||||
let (nrows, ncols) = self.shape();
|
let (nrows, ncols) = self.shape();
|
||||||
for row in 0..nrows {
|
for row in 0..nrows {
|
||||||
|
|||||||
+1
-1
@@ -1110,7 +1110,7 @@ mod tests {
|
|||||||
let svc = SVC::fit(&x, &y, ¶ms).unwrap();
|
let svc = SVC::fit(&x, &y, ¶ms).unwrap();
|
||||||
|
|
||||||
// serialization
|
// serialization
|
||||||
let deserialized_svc: SVC<f64, i32, _, _> =
|
let deserialized_svc: SVC<'_, f64, i32, _, _> =
|
||||||
serde_json::from_str(&serde_json::to_string(&svc).unwrap()).unwrap();
|
serde_json::from_str(&serde_json::to_string(&svc).unwrap()).unwrap();
|
||||||
|
|
||||||
assert_eq!(svc, deserialized_svc);
|
assert_eq!(svc, deserialized_svc);
|
||||||
|
|||||||
+1
-1
@@ -702,7 +702,7 @@ mod tests {
|
|||||||
|
|
||||||
let svr = SVR::fit(&x, &y, ¶ms).unwrap();
|
let svr = SVR::fit(&x, &y, ¶ms).unwrap();
|
||||||
|
|
||||||
let deserialized_svr: SVR<f64, DenseMatrix<f64>, _> =
|
let deserialized_svr: SVR<'_, f64, DenseMatrix<f64>, _> =
|
||||||
serde_json::from_str(&serde_json::to_string(&svr).unwrap()).unwrap();
|
serde_json::from_str(&serde_json::to_string(&svr).unwrap()).unwrap();
|
||||||
|
|
||||||
assert_eq!(svr, deserialized_svr);
|
assert_eq!(svr, deserialized_svr);
|
||||||
|
|||||||
Reference in New Issue
Block a user