Fri, 16 Jan 2026 19:39:22 -0500
Lipschitz estimation attempt (incomplete, not implemented for sliding. Doesn't work anyway for basic FB either.)
| 0 | 1 | /*! |
| 2 | Fourier transform traits | |
| 3 | */ | |
| 4 | ||
| 5 | use alg_tools::bisection_tree::Weighted; | |
| 6 | use alg_tools::loc::Loc; | |
|
61
4f468d35fa29
General forward operators, separation of measures into own crate, and other architecture improvements to support the pointsource_pde crate.
Tuomo Valkonen <tuomov@iki.fi>
parents:
35
diff
changeset
|
7 | use alg_tools::mapping::{Mapping, RealMapping, Space}; |
|
4f468d35fa29
General forward operators, separation of measures into own crate, and other architecture improvements to support the pointsource_pde crate.
Tuomo Valkonen <tuomov@iki.fi>
parents:
35
diff
changeset
|
8 | use alg_tools::types::{Float, Num}; |
| 0 | 9 | |
| 10 | /// Trait for Fourier transforms. When F is a non-complex number, the transform | |
| 11 | /// also has to be non-complex, i.e., the function itself symmetric. | |
|
61
4f468d35fa29
General forward operators, separation of measures into own crate, and other architecture improvements to support the pointsource_pde crate.
Tuomo Valkonen <tuomov@iki.fi>
parents:
35
diff
changeset
|
12 | pub trait Fourier<F: Num>: Mapping<Self::Domain, Codomain = F> { |
|
4f468d35fa29
General forward operators, separation of measures into own crate, and other architecture improvements to support the pointsource_pde crate.
Tuomo Valkonen <tuomov@iki.fi>
parents:
35
diff
changeset
|
13 | type Domain: Space; |
|
4f468d35fa29
General forward operators, separation of measures into own crate, and other architecture improvements to support the pointsource_pde crate.
Tuomo Valkonen <tuomov@iki.fi>
parents:
35
diff
changeset
|
14 | type Transformed: Mapping<Self::Domain, Codomain = F>; |
| 0 | 15 | |
| 16 | fn fourier(&self) -> Self::Transformed; | |
| 17 | } | |
| 18 | ||
|
61
4f468d35fa29
General forward operators, separation of measures into own crate, and other architecture improvements to support the pointsource_pde crate.
Tuomo Valkonen <tuomov@iki.fi>
parents:
35
diff
changeset
|
19 | impl<F: Float, T, const N: usize> Fourier<F> for Weighted<T, F> |
|
4f468d35fa29
General forward operators, separation of measures into own crate, and other architecture improvements to support the pointsource_pde crate.
Tuomo Valkonen <tuomov@iki.fi>
parents:
35
diff
changeset
|
20 | where |
|
4f468d35fa29
General forward operators, separation of measures into own crate, and other architecture improvements to support the pointsource_pde crate.
Tuomo Valkonen <tuomov@iki.fi>
parents:
35
diff
changeset
|
21 | T: Fourier<F, Domain = Loc<N, F>> + RealMapping<N, F>, |
|
4f468d35fa29
General forward operators, separation of measures into own crate, and other architecture improvements to support the pointsource_pde crate.
Tuomo Valkonen <tuomov@iki.fi>
parents:
35
diff
changeset
|
22 | { |
| 0 | 23 | type Domain = T::Domain; |
| 24 | type Transformed = Weighted<T::Transformed, F>; | |
| 25 | ||
| 26 | #[inline] | |
| 27 | fn fourier(&self) -> Self::Transformed { | |
| 28 | Weighted { | |
|
61
4f468d35fa29
General forward operators, separation of measures into own crate, and other architecture improvements to support the pointsource_pde crate.
Tuomo Valkonen <tuomov@iki.fi>
parents:
35
diff
changeset
|
29 | base_fn: self.base_fn.fourier(), |
|
4f468d35fa29
General forward operators, separation of measures into own crate, and other architecture improvements to support the pointsource_pde crate.
Tuomo Valkonen <tuomov@iki.fi>
parents:
35
diff
changeset
|
30 | weight: self.weight, |
| 0 | 31 | } |
| 32 | } | |
| 33 | } |