pub enum ResponseManifold {
Spd {
n: usize,
},
Grassmann {
k: usize,
n: usize,
},
Stiefel {
k: usize,
n: usize,
},
Poincare {
dim: usize,
curvature: f64,
},
ConstantCurvature {
dim: usize,
kappa: f64,
},
}Expand description
A fittable curved response geometry. Each variant carries the shape the user
requested; the embedding/ambient flat dimension is fixed by that shape and
is the column count of the values matrix the caller supplies.
Variants§
Spd
Symmetric positive-definite n×n matrices, flattened row-major to n²
ambient coordinates (the layout SpdManifold uses).
Grassmann
k-dimensional subspaces of ℝⁿ, represented by an orthonormal n×k
frame flattened to n·k ambient coordinates.
Stiefel
Orthonormal k-frames in ℝⁿ, flattened to n·k ambient coordinates.
Poincare
The Poincaré ball of dimension d with curvature κ < 0.
ConstantCurvature
Constant-curvature manifold M_κ of dimension d with curvature κ
(any finite real value). κ > 0 → spherical, κ = 0 → flat (Euclidean
up to scale), κ < 0 → hyperbolic (Poincaré ball). Unlike Poincare,
which fixes κ < 0, this variant accepts any curvature including zero
and positive values, and is the target for curvature-as-estimand fits
where κ̂ is optimized over all of ℝ (#1104).
Implementations§
Source§impl ResponseManifold
impl ResponseManifold
Sourcepub fn resolve(
kind: &str,
n: Option<usize>,
k: Option<usize>,
dim: Option<usize>,
curvature: Option<f64>,
) -> Result<Self, String>
pub fn resolve( kind: &str, n: Option<usize>, k: Option<usize>, dim: Option<usize>, curvature: Option<f64>, ) -> Result<Self, String>
Resolve a lower-cased geometry label and its shape parameters into a response manifold. Shape parameters are passed positionally exactly as the FFI marshals them; absent/zero values are rejected here so the error surfaces at selection time rather than mid-fit.
"spd"needsn(matrix side)."grassmann"/"stiefel"needkandnwith1 ≤ k ≤ n."poincare"needsdimand a strictly negativecurvature.
Sourcepub fn parse(label: &str, cols: usize) -> Result<Self, String>
pub fn parse(label: &str, cols: usize) -> Result<Self, String>
Parse a user-facing response_geometry label, magic-by-default: the head
is the geometry name, an optional parenthesised key=value list carries
shape parameters, and anything not given is inferred from the ambient
column count cols of the response matrix.
Recognised forms (case-insensitive, whitespace tolerant):
"spd"—n = √cols(must be a perfect square)."grassmann(k=2)"or"grassmann(k=2,n=5)"—ndefaults tocols / k;kis required (it cannot be inferred fromn·k)."stiefel(k=2)"/"stiefel(k=2,n=5)"— same inference as Grassmann."poincare"or"poincare(curvature=-0.5)"—dim = cols; curvature defaults to-1.0.
This is the single mapping from the formula-DSL string to a constructed response manifold; the FFI passes the raw label straight through.
Sourcepub fn canonical_label(&self) -> String
pub fn canonical_label(&self) -> String
Canonical, fully-specified label echoed back to the caller (mirrors the way the sphere/simplex dispatch reports its resolved coordinate label).
Sourcepub fn ambient_dim(&self) -> usize
pub fn ambient_dim(&self) -> usize
Ambient (flattened) coordinate count: the column width of the values
matrix and the base vector.
Trait Implementations§
Source§impl Clone for ResponseManifold
impl Clone for ResponseManifold
Source§fn clone(&self) -> ResponseManifold
fn clone(&self) -> ResponseManifold
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ResponseManifold
Source§impl Debug for ResponseManifold
impl Debug for ResponseManifold
Source§impl PartialEq for ResponseManifold
impl PartialEq for ResponseManifold
Source§fn eq(&self, other: &ResponseManifold) -> bool
fn eq(&self, other: &ResponseManifold) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ResponseManifold
Auto Trait Implementations§
impl Freeze for ResponseManifold
impl RefUnwindSafe for ResponseManifold
impl Send for ResponseManifold
impl Sync for ResponseManifold
impl Unpin for ResponseManifold
impl UnsafeUnpin for ResponseManifold
impl UnwindSafe for ResponseManifold
Blanket Implementations§
impl<T> Boilerplate 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
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>
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
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>
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.