Reduced

Struct Reduced 

Source
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:

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: bool

Whether 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: bool

Whether 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>

Source

pub(super) fn new(v: Jet<N>, t: Jet<N>, sheet: Option<Sheet>) -> Self

Source

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.

Source

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.

Source

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.

Source

fn turns(&self) -> Option<f64>

The turns from the principal argument of v to its sheet, for gamma_limit.

Source

fn value(&mut self, twice_n: i32) -> (Complex, f64)

Source

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.

Source

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.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,