pub struct MarginalSlopeCovariance { /* private fields */ }Expand description
Immutable, validated covariance geometry for the physical log-slope vector.
Admission is the single validation boundary. Diagonal covariance entries
remain the sole authority for their quadratic forms. Full covariances cache
an eigensquare-root factor so subsequent quadratic forms are exact sums of
squares; runtime code never repeats an eigendecomposition or applies a
negative-value tolerance. The exact 1ᵀΣ1 shared-slope geometry is cached
at the same boundary.
Implementations§
Source§impl MarginalSlopeCovariance
impl MarginalSlopeCovariance
pub fn diagonal(covariance: Array1<f64>) -> Result<Self, String>
pub fn full(covariance: Array2<f64>) -> Result<Self, String>
pub fn low_rank(factor: Array2<f64>) -> Result<Self, String>
pub fn to_dense(&self) -> Array2<f64>
pub fn shape(&self) -> MarginalSlopeCovarianceShape
pub fn dim(&self) -> usize
pub fn ones_quadratic_form(&self) -> f64
pub fn quadratic_form(&self, vector: &[f64]) -> Result<f64, String>
Trait Implementations§
Source§impl Clone for MarginalSlopeCovariance
impl Clone for MarginalSlopeCovariance
Source§fn clone(&self) -> MarginalSlopeCovariance
fn clone(&self) -> MarginalSlopeCovariance
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 MarginalSlopeCovariance
impl Debug for MarginalSlopeCovariance
Source§impl From<MarginalSlopeCovariance> for ScoreCovarianceField
impl From<MarginalSlopeCovariance> for ScoreCovarianceField
Source§fn from(pooled: MarginalSlopeCovariance) -> Self
fn from(pooled: MarginalSlopeCovariance) -> Self
Converts to this type from the input type.
Source§impl PartialEq for MarginalSlopeCovariance
impl PartialEq for MarginalSlopeCovariance
Source§impl SymmetricQuadraticCoefficients for MarginalSlopeCovariance
impl SymmetricQuadraticCoefficients for MarginalSlopeCovariance
Source§fn multiply(&self, input: &[f64], output: &mut [f64])
fn multiply(&self, input: &[f64], output: &mut [f64])
Compute
output = A * input without materializing A.Source§fn coefficient(&self, row: usize, column: usize) -> f64
fn coefficient(&self, row: usize, column: usize) -> f64
One symmetric coefficient
A[row, column].Source§fn visit_upper_triangle(
&self,
direction: &mut [f64],
projected: &mut [f64],
visit: impl FnMut(usize, usize, f64),
)
fn visit_upper_triangle( &self, direction: &mut [f64], projected: &mut [f64], visit: impl FnMut(usize, usize, f64), )
Visit the operator’s input-space upper triangle without materializing a
dense matrix. The default probes one basis direction at a time through
Self::multiply, preserving matrix-free operators. Representations
with direct structure should override this hook so a packed curvature
lowering is O(K), O(K²), or O(K²R) as appropriate instead of performing
K full operator applications. Read moreSource§fn quadratic_value<T, F>(&self, input: &[T], value: F) -> f64
fn quadratic_value<T, F>(&self, input: &[T], value: F) -> f64
Evaluate the primal quadratic form without materializing the input as a
separate
f64 vector. Structured operators should override this to
preserve their representation’s natural complexity (for example O(KR)
for a K-by-R low-rank factor).Auto Trait Implementations§
impl Freeze for MarginalSlopeCovariance
impl RefUnwindSafe for MarginalSlopeCovariance
impl Send for MarginalSlopeCovariance
impl Sync for MarginalSlopeCovariance
impl Unpin for MarginalSlopeCovariance
impl UnsafeUnpin for MarginalSlopeCovariance
impl UnwindSafe for MarginalSlopeCovariance
Blanket Implementations§
impl<T> Allocation for T
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.