From e2e5f0dd524a24f37b259825ad4e494ee381859e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 22 Jun 2024 15:03:06 +0200 Subject: [PATCH] feat: add a SupersetOf requirement for the ComplexField and SimdComplexField traits --- CHANGELOG | 2 ++ src/scalar/complex.rs | 1 + src/simd/simd_complex.rs | 29 +++++++++++++++-------------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e2aad14..5656327 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,8 @@ - Add the `portable_simd` feature for supporting `std::simd`. - The `ClosedAdd, ClosedMul, etc.` traits no longer require `AddAssign, MulAssign`. Instead they are required for new traits named `ClosedAddAssign, ClosedMulAssign, etc.` +- The `ComplexField` and `SimdComplexField` (and, by extension, `RealField` and `SimdRealField`) traits now depend on the + `SupersetOf` trait in addition to `SupersetOf`. ## Release v0.8.1 (04 Apr. 2023) - Add implementation of `rkyv` serialization/deserialization to the `Wide*` wrapper types. diff --git a/src/scalar/complex.rs b/src/scalar/complex.rs index 1c3c739..e28d94e 100644 --- a/src/scalar/complex.rs +++ b/src/scalar/complex.rs @@ -161,6 +161,7 @@ macro_rules! complex_trait_methods ( #[allow(missing_docs)] pub trait ComplexField: SubsetOf ++ SupersetOf + SupersetOf + FromPrimitive + Field diff --git a/src/simd/simd_complex.rs b/src/simd/simd_complex.rs index 5bdd02e..0d73326 100644 --- a/src/simd/simd_complex.rs +++ b/src/simd/simd_complex.rs @@ -12,24 +12,25 @@ use crate::simd::{SimdRealField, SimdValue}; /// Each lane of an SIMD complex field should contain one complex field. #[allow(missing_docs)] pub trait SimdComplexField: - SubsetOf - + SupersetOf - + Field - + Clone - + Neg +SubsetOf ++ SupersetOf ++ SupersetOf ++ Field ++ Clone ++ Neg // + MeetSemilattice // + JoinSemilattice - + Send - + Sync - + Any - + 'static - + Debug - + NumAssignOps - + NumOps - + PartialEq ++ Send ++ Sync ++ Any ++ 'static ++ Debug ++ NumAssignOps ++ NumOps ++ PartialEq { /// Type of the coefficients of a complex number. - type SimdRealField: SimdRealField::SimdBool>; + type SimdRealField: SimdRealField::SimdBool>; complex_trait_methods!(SimdRealField, simd_); /// Computes the sum of all the lanes of `self`.