Skip to content

Commit

Permalink
fix compilation of nalgebra-lapack
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcrozet committed May 20, 2024
1 parent c4a18ee commit 5cc597b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 50 deletions.
46 changes: 23 additions & 23 deletions nalgebra-lapack/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
[package]
name = "nalgebra-lapack"
name = "nalgebra-lapack"
version = "0.24.0"
authors = [ "Sébastien Crozet <[email protected]>", "Andrew Straw <[email protected]>" ]
authors = ["Sébastien Crozet <[email protected]>", "Andrew Straw <[email protected]>"]

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"

[badges]
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"

5 changes: 2 additions & 3 deletions nalgebra-lapack/src/generalized_eigenvalues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ where
/// as columns.
pub fn eigenvectors(&self) -> (OMatrix<Complex<T>, D, D>, OMatrix<Complex<T>, D, D>)
where
DefaultAllocator:
Allocator<Complex<T>, D, D> + Allocator<Complex<T>, D> + Allocator<(Complex<T>, T), D>,
DefaultAllocator: Allocator<D, D> + Allocator<D>,
{
/*
How the eigenvectors are built up:
Expand Down Expand Up @@ -226,7 +225,7 @@ where
#[must_use]
pub fn raw_eigenvalues(&self) -> OVector<(Complex<T>, T), D>
where
DefaultAllocator: Allocator<(Complex<T>, T), D>,
DefaultAllocator: Allocator<D>,
{
let mut out = Matrix::from_element_generic(
self.vsl.shape_generic().0,
Expand Down
8 changes: 4 additions & 4 deletions nalgebra-lapack/src/lu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ use lapack;
#[cfg_attr(
feature = "serde-serialize",
serde(bound(serialize = "DefaultAllocator: Allocator<R, C> +
Allocator<i32, DimMinimum<R, C>>,
Allocator<DimMinimum<R, C>>,
OMatrix<T, R, C>: Serialize,
PermutationSequence<DimMinimum<R, C>>: Serialize"))
)]
#[cfg_attr(
feature = "serde-serialize",
serde(bound(deserialize = "DefaultAllocator: Allocator<R, C> +
Allocator<i32, DimMinimum<R, C>>,
Allocator<DimMinimum<R, C>>,
OMatrix<T, R, C>: Deserialize<'de>,
PermutationSequence<DimMinimum<R, C>>: Deserialize<'de>"))
)]
#[derive(Clone, Debug)]
pub struct LU<T: Scalar, R: DimMin<C>, C: Dim>
where
DefaultAllocator: Allocator<i32, DimMinimum<R, C>> + Allocator<R, C>,
DefaultAllocator: Allocator<DimMinimum<R, C>> + Allocator<R, C>,
{
lu: OMatrix<T, R, C>,
p: OVector<i32, DimMinimum<R, C>>,
}

impl<T: Scalar + Copy, R: DimMin<C>, C: Dim> Copy for LU<T, R, C>
where
DefaultAllocator: Allocator<R, C> + Allocator<i32, DimMinimum<R, C>>,
DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>>,
OMatrix<T, R, C>: Copy,
OVector<i32, DimMinimum<R, C>>: Copy,
{
Expand Down
2 changes: 1 addition & 1 deletion nalgebra-lapack/src/qz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ where
#[must_use]
pub fn raw_eigenvalues(&self) -> OVector<(Complex<T>, T), D>
where
DefaultAllocator: Allocator<(Complex<T>, T), D>,
DefaultAllocator: Allocator<D>,
{
let mut out = Matrix::from_element_generic(
self.vsl.shape_generic().0,
Expand Down
2 changes: 1 addition & 1 deletion nalgebra-lapack/src/schur.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ where
#[must_use]
pub fn complex_eigenvalues(&self) -> OVector<Complex<T>, D>
where
DefaultAllocator: Allocator<Complex<T>, D>,
DefaultAllocator: Allocator<D>,
{
let mut out = Matrix::zeros_generic(self.t.shape_generic().0, Const::<1>);

Expand Down
34 changes: 16 additions & 18 deletions nalgebra-lapack/src/svd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ where
/// supported by the Singular Value Decompotition.
pub trait SVDScalar<R: DimMin<C>, C: Dim>: Scalar
where
DefaultAllocator: Allocator<Self, R, R>
+ Allocator<Self, R, C>
+ Allocator<Self, DimMinimum<R, C>>
+ Allocator<Self, C, C>,
DefaultAllocator:
Allocator<R, R> + Allocator<R, C> + Allocator<DimMinimum<R, C>> + Allocator<C, C>,
{
/// Computes the SVD decomposition of `m`.
fn compute(m: OMatrix<Self, R, C>) -> Option<SVD<Self, R, C>>;
Expand All @@ -80,10 +78,10 @@ macro_rules! svd_impl(
($t: ty, $lapack_func: path) => (
impl<R: Dim, C: Dim> SVDScalar<R, C> for $t
where R: DimMin<C>,
DefaultAllocator: Allocator<$t, R, C> +
Allocator<$t, R, R> +
Allocator<$t, C, C> +
Allocator<$t, DimMinimum<R, C>> {
DefaultAllocator: Allocator<R, C> +
Allocator<R, R> +
Allocator<C, C> +
Allocator<DimMinimum<R, C>> {

fn compute(mut m: OMatrix<$t, R, C>) -> Option<SVD<$t, R, C>> {
let (nrows, ncols) = m.shape_generic();
Expand Down Expand Up @@ -132,16 +130,16 @@ macro_rules! svd_impl(

impl<R: DimMin<C>, 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<R, C>> +
Allocator<$t, DimMinimum<R, C>, R> +
Allocator<$t, DimMinimum<R, C>, C> +
Allocator<$t, R, DimMinimum<R, C>> +
Allocator<$t, C, C> {
where DefaultAllocator: Allocator<R, C> +
Allocator<C, R> +
Allocator<U1, R> +
Allocator<U1, C> +
Allocator<R, R> +
Allocator<DimMinimum<R, C>> +
Allocator<DimMinimum<R, C>, R> +
Allocator<DimMinimum<R, C>, C> +
Allocator<R, DimMinimum<R, C>> +
Allocator<C, C> {
/// Reconstructs the matrix from its decomposition.
///
/// Useful if some components (e.g. some singular values) of this decomposition have
Expand Down

0 comments on commit 5cc597b

Please sign in to comment.