Fix is_empty method logic in matrix.rs (#336)

* Fix is_empty method logic in matrix.rs
* bump to 0.4.6
* silence some clippy
This commit is contained in:
Lorenzo
2025-11-15 14:22:42 +09:00
committed by GitHub
parent 70212c71e0
commit 36efd582a5
5 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
name = "smartcore" name = "smartcore"
description = "Machine Learning in Rust." description = "Machine Learning in Rust."
homepage = "https://smartcorelib.org" homepage = "https://smartcorelib.org"
version = "0.4.5" version = "0.4.6"
authors = ["smartcore Developers"] authors = ["smartcore Developers"]
edition = "2021" edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
+1 -1
View File
@@ -1,4 +1,4 @@
#![allow(clippy::ptr_arg)] #![allow(clippy::ptr_arg, clippy::needless_range_loop)]
//! # Nearest Neighbors Search Algorithms and Data Structures //! # Nearest Neighbors Search Algorithms and Data Structures
//! //!
//! Nearest neighbor search is a basic computational tool that is particularly relevant to machine learning, //! Nearest neighbor search is a basic computational tool that is particularly relevant to machine learning,
+1
View File
@@ -1,3 +1,4 @@
#![allow(clippy::ptr_arg, clippy::needless_range_loop)]
//! # Clustering //! # Clustering
//! //!
//! Clustering is the type of unsupervised learning where you divide the population or data points into a number of groups such that data points in the same groups //! Clustering is the type of unsupervised learning where you divide the population or data points into a number of groups such that data points in the same groups
+1
View File
@@ -1,3 +1,4 @@
#![allow(clippy::ptr_arg, clippy::needless_range_loop)]
//! Datasets //! Datasets
//! //!
//! In this module you will find small datasets that are used in `smartcore` mostly for demonstration purposes. //! In this module you will find small datasets that are used in `smartcore` mostly for demonstration purposes.
+1 -1
View File
@@ -385,7 +385,7 @@ impl<T: Debug + Display + Copy + Sized> Array<T, (usize, usize)> for DenseMatrix
} }
fn is_empty(&self) -> bool { fn is_empty(&self) -> bool {
self.ncols > 0 && self.nrows > 0 self.ncols < 1 || self.nrows < 1
} }
fn iterator<'b>(&'b self, axis: u8) -> Box<dyn Iterator<Item = &'b T> + 'b> { fn iterator<'b>(&'b self, axis: u8) -> Box<dyn Iterator<Item = &'b T> + 'b> {