pub struct MieResidual {
sizes: Vec<f64>,
materials: Vec<Material>,
interfaces: Vec<Interface>,
inverse: Matrix2,
value: Matrix2,
}Expand description
What mie saves for its pullback: the interface matrices and radial functions of
one degree l, so the pullback evaluates no Bessel functions.
Fields§
§sizes: Vec<f64>§materials: Vec<Material>§interfaces: Vec<Interface>§inverse: Matrix2§value: Matrix2Implementations§
Source§impl MieResidual
impl MieResidual
Sourcepub fn state_size(boundaries: usize) -> Result<usize>
pub fn state_size(boundaries: usize) -> Result<usize>
Exact byte count of the saved Mie state for boundaries layers.
The layout contains one count, the sizes, three material parameters, 62
complex entries per interface, and two coefficient matrices.
pub(crate) fn write_state(&self, writer: &mut Writer)
pub(crate) fn read_state(reader: &mut Reader<'_>) -> Result<Self>
Source§impl MieResidual
impl MieResidual
Sourcepub fn boundaries(&self) -> usize
pub fn boundaries(&self) -> usize
The number of recorded layer boundaries.
Sourcepub fn pushforward(
&self,
sizes: &[f64],
materials: &[Material],
) -> Result<Matrix2>
pub fn pushforward( &self, sizes: &[f64], materials: &[Material], ) -> Result<Matrix2>
The coefficient tangent along changes of the sizes and materials. Each
materials entry stores changes of epsilon, mu and kappa, including the
embedding medium. One combined direction travels through the cached
interfaces; no Bessel functions or parameter Jacobians are evaluated.
Sourcepub fn pullback(&self, cotangent: &Matrix2) -> Result<MieGradient>
pub fn pullback(&self, cotangent: &Matrix2) -> Result<MieGradient>
Gradients of the size parameters 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 MieResidual
impl Clone for MieResidual
Source§fn clone(&self) -> MieResidual
fn clone(&self) -> MieResidual
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MieResidual
impl Debug for MieResidual
Source§impl SavedState for MieResidual
impl SavedState for MieResidual
Auto Trait Implementations§
impl Freeze for MieResidual
impl RefUnwindSafe for MieResidual
impl Send for MieResidual
impl Sync for MieResidual
impl Unpin for MieResidual
impl UnwindSafe for MieResidual
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.