From 46d1cf22314f85cc4f8ad83481b61c090a8ab3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Tue, 25 Aug 2020 20:44:03 +0200 Subject: [PATCH] Add a libm and libm-force feature to transitively enable the corresponding simba feature. --- Cargo.toml | 6 +++--- src/linalg/mod.rs | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d7576d62..9ed76264 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,9 @@ debug = [ "approx/num-complex", "rand/std" ] alloc = [ ] io = [ "pest", "pest_derive" ] compare = [ "matrixcompare-core" ] +libm = [ "simba/libm" ] +libm-force = [ "simba/libm_force" ] + [dependencies] typenum = "1.11" @@ -75,6 +78,3 @@ path = "benches/lib.rs" [profile.bench] lto = true - -#[patch.crates-io] -#simba = { path = "../simba" } \ No newline at end of file diff --git a/src/linalg/mod.rs b/src/linalg/mod.rs index f96cef0c..4a1edbcf 100644 --- a/src/linalg/mod.rs +++ b/src/linalg/mod.rs @@ -5,6 +5,10 @@ mod bidiagonal; mod cholesky; mod convolution; mod determinant; +// FIXME: this should not be needed. However, the exp uses +// explicit float operations on `f32` and `f64`. We need to +// get rid of these to allow exp to be used on a no-std context. +#[cfg(feature = "std")] mod exp; mod full_piv_lu; pub mod givens; @@ -27,6 +31,7 @@ mod symmetric_tridiagonal; pub use self::bidiagonal::*; pub use self::cholesky::*; pub use self::convolution::*; +#[cfg(feature = "std")] pub use self::exp::*; pub use self::full_piv_lu::*; pub use self::hessenberg::*;