From cce50f76485e26d72883d8d0af466a01e98c8ee6 Mon Sep 17 00:00:00 2001 From: Benjamin Lieser Date: Fri, 18 Oct 2024 13:07:02 +0200 Subject: [PATCH] Make SymmetricEigenScalar usable but not implementable --- nalgebra-lapack/src/lib.rs | 2 +- nalgebra-lapack/src/symmetric_eigen.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nalgebra-lapack/src/lib.rs b/nalgebra-lapack/src/lib.rs index ea2e2b532..ef3abd1a7 100644 --- a/nalgebra-lapack/src/lib.rs +++ b/nalgebra-lapack/src/lib.rs @@ -103,7 +103,7 @@ pub use self::qr::QR; pub use self::qz::QZ; pub use self::schur::Schur; pub use self::svd::SVD; -pub use self::symmetric_eigen::SymmetricEigen; +pub use self::symmetric_eigen::{SymmetricEigen, SymmetricEigenScalar}; trait ComplexHelper { type RealPart; diff --git a/nalgebra-lapack/src/symmetric_eigen.rs b/nalgebra-lapack/src/symmetric_eigen.rs index 6fda636ca..3d7eaf956 100644 --- a/nalgebra-lapack/src/symmetric_eigen.rs +++ b/nalgebra-lapack/src/symmetric_eigen.rs @@ -161,6 +161,10 @@ where } } +pub trait Sealed {} +impl Sealed for f32 {} +impl Sealed for f64 {} + /* * * Lapack functions dispatch. @@ -168,7 +172,7 @@ where */ /// Trait implemented by scalars for which Lapack implements the eigendecomposition of symmetric /// real matrices. -pub trait SymmetricEigenScalar: Scalar { +pub trait SymmetricEigenScalar: Scalar + Sealed { #[allow(missing_docs)] fn xsyev( jobz: u8,