src/fourier.rs

branch
dev
changeset 61
4f468d35fa29
parent 35
b087e3eab191
--- a/src/fourier.rs	Sun Apr 27 15:03:51 2025 -0500
+++ b/src/fourier.rs	Thu Feb 26 11:38:43 2026 -0500
@@ -2,31 +2,32 @@
 Fourier transform traits
 */
 
-use alg_tools::types::{Num, Float};
-use alg_tools::mapping::{RealMapping, Mapping, Space};
 use alg_tools::bisection_tree::Weighted;
 use alg_tools::loc::Loc;
+use alg_tools::mapping::{Mapping, RealMapping, Space};
+use alg_tools::types::{Float, Num};
 
 /// Trait for Fourier transforms. When F is a non-complex number, the transform
 /// also has to be non-complex, i.e., the function itself symmetric.
-pub trait Fourier<F : Num> : Mapping<Self::Domain, Codomain=F> {
-    type Domain : Space;
-    type Transformed : Mapping<Self::Domain, Codomain=F>;
+pub trait Fourier<F: Num>: Mapping<Self::Domain, Codomain = F> {
+    type Domain: Space;
+    type Transformed: Mapping<Self::Domain, Codomain = F>;
 
     fn fourier(&self) -> Self::Transformed;
 }
 
-impl<F : Float, T, const N : usize> Fourier<F>
-for Weighted<T, F>
-where T : Fourier<F, Domain = Loc<F, N>> + RealMapping<F, N> {
+impl<F: Float, T, const N: usize> Fourier<F> for Weighted<T, F>
+where
+    T: Fourier<F, Domain = Loc<N, F>> + RealMapping<N, F>,
+{
     type Domain = T::Domain;
     type Transformed = Weighted<T::Transformed, F>;
 
     #[inline]
     fn fourier(&self) -> Self::Transformed {
         Weighted {
-            base_fn : self.base_fn.fourier(),
-            weight : self.weight
+            base_fn: self.base_fn.fourier(),
+            weight: self.weight,
         }
     }
 }

mercurial