pub(super) struct Reduced<const N: usize> {Show 15 fields
v: Jet<N>,
t: Jet<N>,
w: Complex,
sheet: Option<Sheet>,
turns: OnceCell<Option<f64>>,
varies: bool,
known: [Option<(i32, Complex, f64)>; 2],
limits: Vec<Complex>,
ladder: Option<ScaledGammaLadder>,
top: i32,
next: i32,
even_kambe: Option<(EvenKambe, f64)>,
weights: Vec<Complex>,
single: bool,
singles: Vec<Complex>,
}Expand description
Reduced integrals F_n(v, t) of one reciprocal point, as jets.
§Formula
F_n(v, t) = (-1)^n int_1^inf s^(n-1) exp(-v s - t / (2s)) ds, entire in t, with
dF_n/dv = F_(n+1) and dF_n/dt = F_(n-1) / 2; t = w^2 keeps them regular on the
lattice plane and axis. Callers request orders in decreasing steps, so each value is
evaluated once and then serves as a derivative of its neighbours.
§Paths
Near the plane or axis F_n is the series sum_j (t/2)^j / j! F_(n-j)(v, 0) of the
limits reduced_gamma on their sheet, which tends to the limit as t -> 0:
- half-integer
n(2D spherical and 1D cylindrical sums) up toHALF_INTEGER_SERIES_T; - integer
n(1D spherical sums) up toSERIES_T, and their low orders up toSERIES_REACH.
Farther off, the integer orders come from reduced_kambe with their rounding
bounds, and the half-integer ones from one chain of Kambe integrals (EvenKambe).
The errors of the chain are correlated across orders and cancel in the sums (taken
order by order, each to a few ulps, they lose 1.4e-12 of max(|S|, 1)). At small
splits the chain carries the rounding of its pair along the homogeneous solutions of
the recurrence instead, and each diffraction order takes whichever of the chain and
the single integrals bounds the sum more tightly (Self::prefers_single).
Fields§
§v: Jet<N>§t: Jet<N>§w: Complex§sheet: Option<Sheet>The sheet of v for reduced_kambe and the chain, and the turns to it for the
limits once they are needed.
turns: OnceCell<Option<f64>>§varies: boolWhether t carries a derivative.
known: [Option<(i32, Complex, f64)>; 2]The two most recent (2n, F_n, error bound of F_n).
limits: Vec<Complex>The limits F_d(v, 0) at 2d = top, top - 2, ..., next + 2, from the first
order requested down, with the ladder of Gamma(d, v) / v^d that continues them.
ladder: Option<ScaledGammaLadder>§top: i32§next: i32§even_kambe: Option<(EvenKambe, f64)>The chain of the half-integer orders, with the factor that turns its Kambe
integrals into F_n / w^2n.
weights: Vec<Complex>The weights of F_(1/2 - j) in the value of the sum, recorded (Self::weigh)
while the chain serves them.
single: boolWhether the half-integer orders take the Kambe integrals of the chain one by one
(Self::prefers_single), and those it evaluated, I_0, I_-2, ....
singles: Vec<Complex>Implementations§
Source§impl<const N: usize> Reduced<N>
impl<const N: usize> Reduced<N>
pub(super) fn new(v: Jet<N>, t: Jet<N>, sheet: Option<Sheet>) -> Self
Sourcepub(super) fn weigh(&mut self, twice_n: i32, weight: Complex)
pub(super) fn weigh(&mut self, twice_n: i32, weight: Complex)
Records weight, the factor of the value of F_n in the sum (2n = twice_n),
for Self::prefers_single where the chain serves it.
Sourcepub(super) fn prefers_single(&mut self) -> bool
pub(super) fn prefers_single(&mut self) -> bool
Whether the half-integer orders bound the sum they were weighed in
(Self::weigh) more tightly one by one (EvenKambe::single) than from the
chain (EvenKambe::sum_bounds), which they then take from here on. The single
integrals are evaluated only where the chain’s bound exceeds the moduli of the
terms.
Sourcepub(super) fn by_even_recurrence(&mut self, twice_n: i32) -> Complex
pub(super) fn by_even_recurrence(&mut self, twice_n: i32) -> Complex
Half-integer F_n = 2 I_(2n-1)(x, eta) w^2n from the chain of the even Kambe
orders, whose series takes the root sqrt(v) = x eta / sqrt 2 (Re x >= 0). Where
that is not the root |v|^(1/2) e^(i sheet / 2) of the sheet the chain takes the
split -eta: the even I_(2n-1) are odd in eta on a fixed root.
Sourcefn turns(&self) -> Option<f64>
fn turns(&self) -> Option<f64>
The turns from the principal argument of v to its sheet, for gamma_limit.
fn value(&mut self, twice_n: i32) -> (Complex, f64)
Sourcepub(super) fn series(&mut self, twice_n: i32) -> (Complex, f64)
pub(super) fn series(&mut self, twice_n: i32) -> (Complex, f64)
F_n(v, t) from its series in t, with the sum of the moduli of its terms as its
rounding bound in units of epsilon. The limits F_(n-j)(v, 0) stay within a small
factor of each other, so once the coefficients (t/2)^j / j! halve per term, the
first term below a quarter ulp of the moduli bounds the rest.
Sourcefn limit(&mut self, twice_d: i32) -> Complex
fn limit(&mut self, twice_d: i32) -> Complex
F_d(v, 0) of reduced_gamma for the series, once per order from the first one
requested down: Gamma(d, v) / v^d of a ScaledGammaLadder times v^d / (-v)^d.
Sourcepub(super) fn get(&mut self, twice_n: i32) -> (Jet<N>, Rounding<N>)
pub(super) fn get(&mut self, twice_n: i32) -> (Jet<N>, Rounding<N>)
F_n as a jet, with the error bounds of its value and derivatives from those of
the orders reduced_kambe returns.
Sourcepub(super) fn get_plane_cached(
&self,
twice_n: i32,
cached: &mut Vec<Option<Complex>>,
) -> Jet<N>
pub(super) fn get_plane_cached( &self, twice_n: i32, cached: &mut Vec<Option<Complex>>, ) -> Jet<N>
On-plane half-integer orders shared by the spherical harmonics of one degree. Their scalar gamma limits do not depend on the harmonic or on the order in which they are requested. The largest requested order is 3/2, the derivative of F_(1/2). The plane has t = dt = 0, so only v varies.
Auto Trait Implementations§
impl<const N: usize> !Freeze for Reduced<N>
impl<const N: usize> !RefUnwindSafe for Reduced<N>
impl<const N: usize> Send for Reduced<N>
impl<const N: usize> !Sync for Reduced<N>
impl<const N: usize> Unpin for Reduced<N>
impl<const N: usize> UnwindSafe for Reduced<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.