diff --git a/nalgebra-lapack/Cargo.toml b/nalgebra-lapack/Cargo.toml index 95153a2cc..ef9bea2b7 100644 --- a/nalgebra-lapack/Cargo.toml +++ b/nalgebra-lapack/Cargo.toml @@ -1,15 +1,15 @@ [package] -name = "nalgebra-lapack" +name = "nalgebra-lapack" version = "0.24.0" -authors = [ "Sébastien Crozet ", "Andrew Straw " ] +authors = ["Sébastien Crozet ", "Andrew Straw "] -description = "Matrix decompositions using nalgebra matrices and Lapack bindings." +description = "Matrix decompositions using nalgebra matrices and Lapack bindings." documentation = "https://www.nalgebra.org/docs" homepage = "https://nalgebra.org" repository = "https://github.com/dimforge/nalgebra" readme = "../README.md" -categories = [ "science", "mathematics" ] -keywords = [ "linear", "algebra", "matrix", "vector", "lapack" ] +categories = ["science", "mathematics"] +keywords = ["linear", "algebra", "matrix", "vector", "lapack"] license = "MIT" edition = "2018" @@ -17,31 +17,31 @@ edition = "2018" maintenance = { status = "actively-developed" } [features] -serde-serialize = [ "serde", "nalgebra/serde-serialize" ] -proptest-support = [ "nalgebra/proptest-support" ] -arbitrary = [ "nalgebra/arbitrary" ] +serde-serialize = ["serde", "nalgebra/serde-serialize"] +proptest-support = ["nalgebra/proptest-support"] +arbitrary = ["nalgebra/arbitrary"] # For BLAS/LAPACK -default = ["netlib"] -openblas = ["lapack-src/openblas"] -netlib = ["lapack-src/netlib"] +default = ["openblas"] +openblas = ["lapack-src/openblas"] +netlib = ["lapack-src/netlib"] accelerate = ["lapack-src/accelerate"] -intel-mkl = ["lapack-src/intel-mkl"] +intel-mkl = ["lapack-src/intel-mkl"] [dependencies] -nalgebra = { version = "0.32", path = ".." } -num-traits = "0.2" -num-complex = { version = "0.4", default-features = false } -simba = "0.8" -serde = { version = "1.0", features = [ "derive" ], optional = true } -lapack = { version = "0.19", default-features = false } -lapack-src = { version = "0.8", default-features = false } +nalgebra = { version = "0.32", path = ".." } +num-traits = "0.2" +num-complex = { version = "0.4", default-features = false } +simba = "0.8" +serde = { version = "1.0", features = ["derive"], optional = true } +lapack = { version = "0.19", default-features = false } +lapack-src = { version = "0.8", default-features = false } # clippy = "*" [dev-dependencies] -nalgebra = { version = "0.32", features = [ "arbitrary", "rand" ], path = ".." } -proptest = { version = "1", default-features = false, features = ["std"] } +nalgebra = { version = "0.32", features = ["arbitrary", "rand"], path = ".." } +proptest = { version = "1", default-features = false, features = ["std"] } quickcheck = "1" -approx = "0.5" -rand = "0.8" +approx = "0.5" +rand = "0.8" diff --git a/nalgebra-lapack/src/eigen.rs b/nalgebra-lapack/src/eigen.rs index ceb405551..6ccf8804e 100644 --- a/nalgebra-lapack/src/eigen.rs +++ b/nalgebra-lapack/src/eigen.rs @@ -230,7 +230,7 @@ where Option, D>>>, ) where - DefaultAllocator: Allocator, D>, + DefaultAllocator: Allocator, { match self.eigenvalues_are_real() { true => (None, None, None), diff --git a/nalgebra-lapack/src/generalized_eigenvalues.rs b/nalgebra-lapack/src/generalized_eigenvalues.rs index 94a87c234..33312868f 100644 --- a/nalgebra-lapack/src/generalized_eigenvalues.rs +++ b/nalgebra-lapack/src/generalized_eigenvalues.rs @@ -158,8 +158,7 @@ where /// as columns. pub fn eigenvectors(&self) -> (OMatrix, D, D>, OMatrix, D, D>) where - DefaultAllocator: - Allocator, D, D> + Allocator, D> + Allocator<(Complex, T), D>, + DefaultAllocator: Allocator + Allocator, { /* How the eigenvectors are built up: @@ -226,7 +225,7 @@ where #[must_use] pub fn raw_eigenvalues(&self) -> OVector<(Complex, T), D> where - DefaultAllocator: Allocator<(Complex, T), D>, + DefaultAllocator: Allocator, { let mut out = Matrix::from_element_generic( self.vsl.shape_generic().0, diff --git a/nalgebra-lapack/src/lu.rs b/nalgebra-lapack/src/lu.rs index e2d6ac00c..f38e675ca 100644 --- a/nalgebra-lapack/src/lu.rs +++ b/nalgebra-lapack/src/lu.rs @@ -21,21 +21,21 @@ use lapack; #[cfg_attr( feature = "serde-serialize", serde(bound(serialize = "DefaultAllocator: Allocator + - Allocator>, + Allocator>, OMatrix: Serialize, PermutationSequence>: Serialize")) )] #[cfg_attr( feature = "serde-serialize", serde(bound(deserialize = "DefaultAllocator: Allocator + - Allocator>, + Allocator>, OMatrix: Deserialize<'de>, PermutationSequence>: Deserialize<'de>")) )] #[derive(Clone, Debug)] pub struct LU, C: Dim> where - DefaultAllocator: Allocator> + Allocator, + DefaultAllocator: Allocator> + Allocator, { lu: OMatrix, p: OVector>, @@ -43,7 +43,7 @@ where impl, C: Dim> Copy for LU where - DefaultAllocator: Allocator + Allocator>, + DefaultAllocator: Allocator + Allocator>, OMatrix: Copy, OVector>: Copy, { @@ -57,7 +57,7 @@ where + Allocator + Allocator> + Allocator, C> - + Allocator>, + + Allocator>, { /// Computes the LU decomposition with partial (row) pivoting of `matrix`. pub fn new(mut m: OMatrix) -> Self { @@ -153,7 +153,7 @@ where fn generic_solve_mut(&self, trans: u8, b: &mut OMatrix) -> bool where - DefaultAllocator: Allocator + Allocator, + DefaultAllocator: Allocator + Allocator, { let dim = self.lu.nrows(); @@ -192,7 +192,7 @@ where ) -> Option> where S2: Storage, - DefaultAllocator: Allocator + Allocator, + DefaultAllocator: Allocator + Allocator, { let mut res = b.clone_owned(); if self.generic_solve_mut(b'T', &mut res) { @@ -210,7 +210,7 @@ where ) -> Option> where S2: Storage, - DefaultAllocator: Allocator + Allocator, + DefaultAllocator: Allocator + Allocator, { let mut res = b.clone_owned(); if self.generic_solve_mut(b'T', &mut res) { @@ -228,7 +228,7 @@ where ) -> Option> where S2: Storage, - DefaultAllocator: Allocator + Allocator, + DefaultAllocator: Allocator + Allocator, { let mut res = b.clone_owned(); if self.generic_solve_mut(b'T', &mut res) { @@ -243,7 +243,7 @@ where /// Returns `false` if no solution was found (the decomposed matrix is singular). pub fn solve_mut(&self, b: &mut OMatrix) -> bool where - DefaultAllocator: Allocator + Allocator, + DefaultAllocator: Allocator + Allocator, { self.generic_solve_mut(b'T', b) } @@ -254,7 +254,7 @@ where /// Returns `false` if no solution was found (the decomposed matrix is singular). pub fn solve_transpose_mut(&self, b: &mut OMatrix) -> bool where - DefaultAllocator: Allocator + Allocator, + DefaultAllocator: Allocator + Allocator, { self.generic_solve_mut(b'T', b) } @@ -265,7 +265,7 @@ where /// Returns `false` if no solution was found (the decomposed matrix is singular). pub fn solve_adjoint_mut(&self, b: &mut OMatrix) -> bool where - DefaultAllocator: Allocator + Allocator, + DefaultAllocator: Allocator + Allocator, { self.generic_solve_mut(b'T', b) } @@ -275,7 +275,7 @@ impl LU where T: Zero + One, D: DimMin, - DefaultAllocator: Allocator + Allocator, + DefaultAllocator: Allocator + Allocator, { /// Computes the inverse of the decomposed matrix. pub fn inverse(mut self) -> Option> { diff --git a/nalgebra-lapack/src/qz.rs b/nalgebra-lapack/src/qz.rs index 950fc3aa2..ec113e970 100644 --- a/nalgebra-lapack/src/qz.rs +++ b/nalgebra-lapack/src/qz.rs @@ -178,7 +178,7 @@ where #[must_use] pub fn raw_eigenvalues(&self) -> OVector<(Complex, T), D> where - DefaultAllocator: Allocator<(Complex, T), D>, + DefaultAllocator: Allocator, { let mut out = Matrix::from_element_generic( self.vsl.shape_generic().0, diff --git a/nalgebra-lapack/src/schur.rs b/nalgebra-lapack/src/schur.rs index c921694c8..1cc486f9b 100644 --- a/nalgebra-lapack/src/schur.rs +++ b/nalgebra-lapack/src/schur.rs @@ -146,7 +146,7 @@ where #[must_use] pub fn complex_eigenvalues(&self) -> OVector, D> where - DefaultAllocator: Allocator, D>, + DefaultAllocator: Allocator, { let mut out = Matrix::zeros_generic(self.t.shape_generic().0, Const::<1>); diff --git a/nalgebra-lapack/src/svd.rs b/nalgebra-lapack/src/svd.rs index a4e37d322..1d2f2e248 100644 --- a/nalgebra-lapack/src/svd.rs +++ b/nalgebra-lapack/src/svd.rs @@ -56,10 +56,8 @@ where /// supported by the Singular Value Decompotition. pub trait SVDScalar, C: Dim>: Scalar where - DefaultAllocator: Allocator - + Allocator - + Allocator> - + Allocator, + DefaultAllocator: + Allocator + Allocator + Allocator> + Allocator, { /// Computes the SVD decomposition of `m`. fn compute(m: OMatrix) -> Option>; @@ -80,10 +78,10 @@ macro_rules! svd_impl( ($t: ty, $lapack_func: path) => ( impl SVDScalar for $t where R: DimMin, - DefaultAllocator: Allocator<$t, R, C> + - Allocator<$t, R, R> + - Allocator<$t, C, C> + - Allocator<$t, DimMinimum> { + DefaultAllocator: Allocator + + Allocator + + Allocator + + Allocator> { fn compute(mut m: OMatrix<$t, R, C>) -> Option> { let (nrows, ncols) = m.shape_generic(); @@ -132,16 +130,16 @@ macro_rules! svd_impl( impl, C: Dim> SVD<$t, R, C> // TODO: All those bounds… - where DefaultAllocator: Allocator<$t, R, C> + - Allocator<$t, C, R> + - Allocator<$t, U1, R> + - Allocator<$t, U1, C> + - Allocator<$t, R, R> + - Allocator<$t, DimMinimum> + - Allocator<$t, DimMinimum, R> + - Allocator<$t, DimMinimum, C> + - Allocator<$t, R, DimMinimum> + - Allocator<$t, C, C> { + where DefaultAllocator: Allocator + + Allocator + + Allocator + + Allocator + + Allocator + + Allocator> + + Allocator, R> + + Allocator, C> + + Allocator> + + Allocator { /// Reconstructs the matrix from its decomposition. /// /// Useful if some components (e.g. some singular values) of this decomposition have @@ -235,9 +233,9 @@ macro_rules! svd_complex_impl( where R: DimMin, S: ContiguousStorage, R, C>, S::Alloc: OwnedAllocator, R, C, S> + - Allocator, R, R> + - Allocator, C, C> + - Allocator<$t, DimMinimum> { + Allocator + + Allocator + + Allocator> { let (nrows, ncols) = m.shape_generic(); if nrows.value() == 0 || ncols.value() == 0 {