Skip to content

Commit d4a5744

Browse files
committed
cleanup lints
1 parent 97d52e7 commit d4a5744

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

algorithms/linfa-kernel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ features = ["std", "derive"]
2626
[dependencies]
2727
ndarray = "0.15"
2828
num-traits = "0.2"
29-
sprs = { version="0.11.1", default-features = false }
29+
sprs = { version="=0.11.1", default-features = false }
3030

3131
linfa = { version = "0.7.0", path = "../.." }
3232
linfa-nn = { version = "0.7.0", path = "../linfa-nn" }

algorithms/linfa-kernel/src/inner.rs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,7 @@ impl<F: Float> Inner for CsMat<F> {
6161
type Elem = F;
6262

6363
fn dot(&self, rhs: &ArrayView2<F>) -> Array2<F> {
64-
let mut result = Array2::zeros((self.rows(), rhs.ncols()));
65-
66-
// Handle potential sparse matrices
67-
for j in 0..rhs.ncols() {
68-
let col = rhs.column(j);
69-
let col_result = self.mul(&col.to_owned());
70-
// Copy result into appropriate column of output
71-
for i in 0..self.rows() {
72-
result[[i, j]] = col_result[i];
73-
}
74-
}
75-
76-
result
64+
self.mul(rhs)
7765
}
7866
fn sum(&self) -> Array1<F> {
7967
let mut sum = Array1::zeros(self.cols());
@@ -118,19 +106,7 @@ impl<'a, F: Float> Inner for CsMatView<'a, F> {
118106
type Elem = F;
119107

120108
fn dot(&self, rhs: &ArrayView2<F>) -> Array2<F> {
121-
let mut result = Array2::zeros((self.rows(), rhs.ncols()));
122-
123-
// Handle potential sparse matrices
124-
for j in 0..rhs.ncols() {
125-
let col = rhs.column(j);
126-
let col_result = self.mul(&col.to_owned());
127-
// Copy result into appropriate column of output
128-
for i in 0..self.rows() {
129-
result[[i, j]] = col_result[i];
130-
}
131-
}
132-
133-
result
109+
self.mul(rhs)
134110
}
135111
fn sum(&self) -> Array1<F> {
136112
let mut sum = Array1::zeros(self.cols());

algorithms/linfa-preprocessing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ndarray-rand = { version = "0.14" }
2929
unicode-normalization = "0.1.8"
3030
regex = "1.4.5"
3131
encoding = "0.2"
32-
sprs = { version = "0.11.1", default-features = false }
32+
sprs = { version = "=0.11.1", default-features = false }
3333

3434
serde_regex = { version = "1.1", optional = true }
3535

0 commit comments

Comments
 (0)