pub struct PreparedJointRietveldObjective { /* private fields */ }Expand description
Prepared matrix-free sum of all histogram objectives.
Implementations§
Source§impl PreparedJointRietveldObjective
impl PreparedJointRietveldObjective
Sourcepub fn new(
histograms: Vec<JointRietveldHistogram>,
layout: JointRietveldLayout,
) -> Result<Self, JointRietveldError>
pub fn new( histograms: Vec<JointRietveldHistogram>, layout: JointRietveldLayout, ) -> Result<Self, JointRietveldError>
Prepare all histogram products against one shared/local layout.
§Errors
Returns JointRietveldError for a stale layout or objective failure.
Sourcepub const fn layout(&self) -> &JointRietveldLayout
pub const fn layout(&self) -> &JointRietveldLayout
Borrow the joint parameter layout.
Sourcepub fn preparation_evaluation_count(&self) -> usize
pub fn preparation_evaluation_count(&self) -> usize
Return expensive model products consumed while preparing all gradients.
Sourcepub fn normal_product_evaluation_count(&self) -> usize
pub fn normal_product_evaluation_count(&self) -> usize
Return expensive model products consumed by one joint normal product.
Sourcepub fn jvp(
&self,
direction: &[f64],
) -> Result<Vec<JointRietveldProduct>, JointRietveldError>
pub fn jvp( &self, direction: &[f64], ) -> Result<Vec<JointRietveldProduct>, JointRietveldError>
Apply every histogram Jacobian to one joint physical direction.
§Errors
Returns JointRietveldError for an invalid direction or product.
Sourcepub fn vjp(
&self,
sample_weights: &[Vec<f64>],
) -> Result<Vec<f64>, JointRietveldError>
pub fn vjp( &self, sample_weights: &[Vec<f64>], ) -> Result<Vec<f64>, JointRietveldError>
Apply the transpose of the complete joint Jacobian.
Shared structural rows receive the sum of all histogram products.
§Errors
Returns JointRietveldError for histogram/sample shape or product
failures.
Sourcepub fn normal_product(
&self,
direction: &[f64],
damping: f64,
) -> Result<Vec<f64>, JointRietveldError>
pub fn normal_product( &self, direction: &[f64], damping: f64, ) -> Result<Vec<f64>, JointRietveldError>
Apply the summed J^T W J + damping I joint normal operator.
§Errors
Returns JointRietveldError for invalid damping or product state.
Sourcepub fn gradient(&self) -> Result<JointRietveldGradient, JointRietveldError>
pub fn gradient(&self) -> Result<JointRietveldGradient, JointRietveldError>
Evaluate the summed accepted-state objective and physical gradient.
§Errors
Returns JointRietveldError for residual or reverse-product state.
Auto Trait Implementations§
impl !RefUnwindSafe for PreparedJointRietveldObjective
impl !UnwindSafe for PreparedJointRietveldObjective
impl Freeze for PreparedJointRietveldObjective
impl Send for PreparedJointRietveldObjective
impl Sync for PreparedJointRietveldObjective
impl Unpin for PreparedJointRietveldObjective
impl UnsafeUnpin for PreparedJointRietveldObjective
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.