pub struct OwnedSeparableCellMeasure { /* private fields */ }Expand description
Lifetime-free structural geometry and likelihood measure.
The realized (n_rows, n_outputs) shape is part of the value. This makes a
stored measure self-validating and prevents reusing a sparse activity set or
weight vector against a different response grid.
Implementations§
Source§impl OwnedSeparableCellMeasure
impl OwnedSeparableCellMeasure
Sourcepub fn new(
n_rows: usize,
n_outputs: usize,
structural: OwnedStructuralCells,
likelihood_weights: OwnedLikelihoodWeights,
) -> Result<Self, IndexedResponseError>
pub fn new( n_rows: usize, n_outputs: usize, structural: OwnedStructuralCells, likelihood_weights: OwnedLikelihoodWeights, ) -> Result<Self, IndexedResponseError>
Construct and validate an owned response measure.
Sourcepub fn uniform(n_rows: usize, n_outputs: usize) -> Self
pub fn uniform(n_rows: usize, n_outputs: usize) -> Self
All cells present with unit numerical weight.
pub fn n_rows(&self) -> usize
pub fn n_outputs(&self) -> usize
Sourcepub fn as_borrowed(&self) -> SeparableCellMeasure<'_>
pub fn as_borrowed(&self) -> SeparableCellMeasure<'_>
Borrow this owned value through the zero-copy evaluation API.
pub fn is_active(&self, row: usize, output: usize) -> bool
pub fn active_weight(&self, row: usize, output: usize) -> Option<f64>
Sourcepub fn try_for_each_active<E>(
&self,
visitor: impl FnMut(usize, usize, f64) -> Result<(), E>,
) -> Result<(), E>
pub fn try_for_each_active<E>( &self, visitor: impl FnMut(usize, usize, f64) -> Result<(), E>, ) -> Result<(), E>
Visit every structurally active cell in deterministic row-major order.
Sparse inclusion geometry runs in O(active cells); zero numerical
weights remain visible to the visitor because they do not erase model
structure.
Trait Implementations§
Source§impl Clone for OwnedSeparableCellMeasure
impl Clone for OwnedSeparableCellMeasure
Source§fn clone(&self) -> OwnedSeparableCellMeasure
fn clone(&self) -> OwnedSeparableCellMeasure
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OwnedSeparableCellMeasure
impl Debug for OwnedSeparableCellMeasure
impl StructuralPartialEq for OwnedSeparableCellMeasure
Auto Trait Implementations§
impl Freeze for OwnedSeparableCellMeasure
impl RefUnwindSafe for OwnedSeparableCellMeasure
impl Send for OwnedSeparableCellMeasure
impl Sync for OwnedSeparableCellMeasure
impl Unpin for OwnedSeparableCellMeasure
impl UnsafeUnpin for OwnedSeparableCellMeasure
impl UnwindSafe for OwnedSeparableCellMeasure
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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> ⓘ
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 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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar 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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.