Skip to content

Commit 7a34fe7

Browse files
author
Ian
committed
single-utilities upgrade and consolidation of types
1 parent 9ccc368 commit 7a34fe7

File tree

4 files changed

+10
-26
lines changed

4 files changed

+10
-26
lines changed

Cargo.lock

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description = "A Rust port of LAS2 from SVDLIBC"
44
keywords = ["svd"]
55
categories = ["algorithms", "data-structures", "mathematics", "science"]
66
name = "single-svdlib"
7-
version = "1.0.8"
7+
version = "1.0.9"
88
edition = "2021"
99
license-file = "SVDLIBC-LICENSE.txt"
1010

@@ -20,5 +20,5 @@ rand_distr = "0.5.1"
2020
rayon = "1.10.0"
2121
thiserror = "2.0.9"
2222
ndarray = "0.16"
23-
single-utilities = "0.8.7"
24-
nalgebra = {version = "0.34", features = ["rayon"] }
23+
single-utilities = { version = "0.9.0", features = ["convert"] }
24+
nalgebra = { version = "0.34", features = ["rayon"] }

src/randomized/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::error::SvdLibError;
2-
use crate::{Diagnostics, IntoNdarray2, SMat, SvdFloat, SvdRec};
2+
use crate::{Diagnostics, SMat, SvdFloat, SvdRec};
33
use nalgebra_sparse::na::{ComplexField, DMatrix, DVector, RealField};
44
use ndarray::Array1;
55
use rand::prelude::{Distribution, StdRng};
@@ -9,6 +9,7 @@ use rayon::iter::ParallelIterator;
99
use rayon::prelude::IntoParallelIterator;
1010
use std::ops::Mul;
1111
use std::time::Instant;
12+
use single_utilities::traits::IntoNdarray2;
1213

1314
#[derive(Debug, Clone, Copy, PartialEq)]
1415
pub enum PowerIterationNormalizer {

src/utils.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,3 @@ impl SvdFloat for f64 {
111111
(b - a).abs() < f64::EPSILON
112112
}
113113
}
114-
115-
pub trait IntoNdarray2 {
116-
type Out;
117-
118-
fn into_ndarray2(self) -> Self::Out;
119-
}
120-
121-
impl<N: Scalar> IntoNdarray2 for nalgebra::Matrix<N, Dyn, Dyn, nalgebra::VecStorage<N, Dyn, Dyn>>
122-
where
123-
nalgebra::DefaultAllocator:
124-
nalgebra::allocator::Allocator<Dyn, Dyn, Buffer<N> = nalgebra::VecStorage<N, Dyn, Dyn>>,
125-
{
126-
type Out = ndarray::Array2<N>;
127-
128-
fn into_ndarray2(self) -> Self::Out {
129-
ndarray::Array2::from_shape_vec(self.shape().strides(self.strides()), self.data.into())
130-
.unwrap()
131-
}
132-
}

0 commit comments

Comments
 (0)