pub struct MieCylResidual {
order: i32,
kz: f64,
k0: f64,
radii: Vec<f64>,
materials: Vec<Material>,
interfaces: Vec<Interface>,
inverse: Matrix2,
value: Matrix2,
}Expand description
What mie_cyl saves for its pullback: the four-channel interface states and
radial functions, so the pullback evaluates no Bessel functions.
Fields§
§order: i32§kz: f64§k0: f64§radii: Vec<f64>§materials: Vec<Material>§interfaces: Vec<Interface>§inverse: Matrix2§value: Matrix2Implementations§
Source§impl MieCylResidual
impl MieCylResidual
Sourcepub fn state_size(boundaries: usize) -> Result<usize>
pub fn state_size(boundaries: usize) -> Result<usize>
Byte count of the saved numerical state for boundaries layer boundaries.
pub(crate) fn write_state(&self, writer: &mut Writer)
pub(crate) fn read_state(reader: &mut Reader<'_>) -> Result<Self>
Source§impl MieCylResidual
impl MieCylResidual
Sourcepub fn boundaries(&self) -> usize
pub fn boundaries(&self) -> usize
The number of recorded layer boundaries.
Sourcepub const fn value(&self) -> &Matrix2
pub const fn value(&self) -> &Matrix2
The coefficients in negative, positive helicity order, which the pullback reads.
Sourcepub fn pushforward(
&self,
kz: f64,
k0: f64,
radii: &[f64],
materials: &[Material],
) -> Result<Matrix2>
pub fn pushforward( &self, kz: f64, k0: f64, radii: &[f64], materials: &[Material], ) -> Result<Matrix2>
The coefficient tangent along changes of kz, k0, the radii and the
materials. Material entries store changes of epsilon, mu and kappa.
Cached interface inverses and radial derivatives are reused for one forward
pass, with no additional factorizations or Bessel evaluations.
Sourcepub fn pullback(&self, cotangent: &Matrix2) -> Result<MieCylGradient>
pub fn pullback(&self, cotangent: &Matrix2) -> Result<MieCylGradient>
Gradients of kz, k0, the radii and the materials from cotangent, the
gradient of a real loss with respect to the coefficient matrix.
The pullback runs on the calling thread and adds the boundaries in order, from the outermost in.
Trait Implementations§
Source§impl Clone for MieCylResidual
impl Clone for MieCylResidual
Source§fn clone(&self) -> MieCylResidual
fn clone(&self) -> MieCylResidual
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MieCylResidual
impl Debug for MieCylResidual
Source§impl SavedState for MieCylResidual
impl SavedState for MieCylResidual
Auto Trait Implementations§
impl Freeze for MieCylResidual
impl RefUnwindSafe for MieCylResidual
impl Send for MieCylResidual
impl Sync for MieCylResidual
impl Unpin for MieCylResidual
impl UnwindSafe for MieCylResidual
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.