pub struct PreparedRietveldObjective { /* private fields */ }Expand description
Reusable structural values and derivative products for one accepted state.
Implementations§
Source§impl PreparedRietveldObjective
impl PreparedRietveldObjective
Sourcepub fn new(
input: RietveldInput,
options: RietveldCalculationOptions,
layout: RietveldStructuralLayout,
) -> Result<Self, RietveldObjectiveError>
pub fn new( input: RietveldInput, options: RietveldCalculationOptions, layout: RietveldStructuralLayout, ) -> Result<Self, RietveldObjectiveError>
Validate and prepare one structural-only matrix-free objective.
§Errors
Returns RietveldObjectiveError for invalid inputs or preparation.
Sourcepub const fn layout(&self) -> &RietveldStructuralLayout
pub const fn layout(&self) -> &RietveldStructuralLayout
Borrow the stable physical structural layout.
Sourcepub fn dense_element_count(&self) -> Result<usize, RietveldObjectiveError>
pub fn dense_element_count(&self) -> Result<usize, RietveldObjectiveError>
Return the native dense element count required by Self::linearize.
§Errors
Returns RietveldObjectiveError::AllocationOverflow when the product
is not representable as usize.
Sourcepub fn linearize(
&self,
) -> Result<PreparedRietveldLinearization, RietveldObjectiveError>
pub fn linearize( &self, ) -> Result<PreparedRietveldLinearization, RietveldObjectiveError>
Materialize one reusable physical structural Jacobian and calculation.
Values and native analytical derivatives are produced in the same fused engine pass. The layout then projects native rows into stable physical parameter order.
§Errors
Returns RietveldObjectiveError for engine, shape, projection, or
calculation failures.
Sourcepub fn jvp(
&self,
direction: &[f64],
) -> Result<(Vec<f64>, Vec<f64>), RietveldObjectiveError>
pub fn jvp( &self, direction: &[f64], ) -> Result<(Vec<f64>, Vec<f64>), RietveldObjectiveError>
Calculate the structural profile and its physical directional derivative.
§Errors
Returns RietveldObjectiveError for direction or engine failures.
Sourcepub fn vjp(
&self,
sample_weights: &[f64],
) -> Result<Vec<f64>, RietveldObjectiveError>
pub fn vjp( &self, sample_weights: &[f64], ) -> Result<Vec<f64>, RietveldObjectiveError>
Apply the physical structural pattern Jacobian transpose.
§Errors
Returns RietveldObjectiveError for weight or engine failures.
Sourcepub fn normal_product(
&self,
direction: &[f64],
damping: f64,
) -> Result<Vec<f64>, RietveldObjectiveError>
pub fn normal_product( &self, direction: &[f64], damping: f64, ) -> Result<Vec<f64>, RietveldObjectiveError>
Apply J^T W J + damping I without a dense sample Jacobian.
§Errors
Returns RietveldObjectiveError for invalid damping or product state.
Sourcepub fn gradient(&self) -> Result<(Vec<f64>, Vec<f64>), RietveldObjectiveError>
pub fn gradient(&self) -> Result<(Vec<f64>, Vec<f64>), RietveldObjectiveError>
Calculate J^T W (Ycalc - Yobs) and the complete calculated pattern.
§Errors
Returns RietveldObjectiveError for calculation or reverse-product
failures.
Auto Trait Implementations§
impl !RefUnwindSafe for PreparedRietveldObjective
impl !UnwindSafe for PreparedRietveldObjective
impl Freeze for PreparedRietveldObjective
impl Send for PreparedRietveldObjective
impl Sync for PreparedRietveldObjective
impl Unpin for PreparedRietveldObjective
impl UnsafeUnpin for PreparedRietveldObjective
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.