Skip to content

Commit 36efd58

Browse files
authored
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
1 parent 70212c7 commit 36efd58

File tree

5 files changed

+5
-3
lines changed

5 files changed

+5
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "smartcore"
33
description = "Machine Learning in Rust."
44
homepage = "https://smartcorelib.org"
5-
version = "0.4.5"
5+
version = "0.4.6"
66
authors = ["smartcore Developers"]
77
edition = "2021"
88
license = "Apache-2.0"

src/algorithm/neighbour/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::ptr_arg)]
1+
#![allow(clippy::ptr_arg, clippy::needless_range_loop)]
22
//! # Nearest Neighbors Search Algorithms and Data Structures
33
//!
44
//! Nearest neighbor search is a basic computational tool that is particularly relevant to machine learning,

src/cluster/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(clippy::ptr_arg, clippy::needless_range_loop)]
12
//! # Clustering
23
//!
34
//! 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

src/dataset/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(clippy::ptr_arg, clippy::needless_range_loop)]
12
//! Datasets
23
//!
34
//! In this module you will find small datasets that are used in `smartcore` mostly for demonstration purposes.

src/linalg/basic/matrix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ impl<T: Debug + Display + Copy + Sized> Array<T, (usize, usize)> for DenseMatrix
385385
}
386386

387387
fn is_empty(&self) -> bool {
388-
self.ncols > 0 && self.nrows > 0
388+
self.ncols < 1 || self.nrows < 1
389389
}
390390

391391
fn iterator<'b>(&'b self, axis: u8) -> Box<dyn Iterator<Item = &'b T> + 'b> {

0 commit comments

Comments
 (0)