pub struct ResolvedGroupHierarchy<C: Ord + Clone> { /* private fields */ }Expand description
Validated coefficient-group hierarchy over carrier coordinates C.
Construction enforces the full group policy (unique non-empty labels,
non-empty coordinate sets, acyclic parent chains terminating at known
groups, child ⊆ parent, interior coordinates == union of children). After
construction, callers walk groups in their original order and request the
concatenated penalty components per group.
Implementations§
Source§impl<C: Ord + Clone> ResolvedGroupHierarchy<C>
impl<C: Ord + Clone> ResolvedGroupHierarchy<C>
Sourcepub fn build(groups: Vec<ResolvedGroup<C>>) -> Result<Self, String>
pub fn build(groups: Vec<ResolvedGroup<C>>) -> Result<Self, String>
Validate the carrier-resolved groups and build the hierarchy.
groups must already have had each selector resolved into coordinates
by the carrier. The order of groups is preserved for Self::groups.
Sourcepub fn groups(&self) -> &[ResolvedGroup<C>]
pub fn groups(&self) -> &[ResolvedGroup<C>]
The resolved groups, in their original declaration order.
Sourcepub fn concatenated_penalty_components(&self, label: &str) -> Vec<BTreeSet<C>>
pub fn concatenated_penalty_components(&self, label: &str) -> Vec<BTreeSet<C>>
Concatenated penalty components for label, recursively expanded.
A leaf group yields a single component (its own coordinate set). An interior node yields the concatenation of its children’s components, expanding recursively when a child is itself interior. This realizes the hierarchical-Gamma identity in which an interior node’s coefficient vector is the concatenation of its child vectors under one precision: overlapping children stay separate factors so their log normalizers and quadratic contributions both add — it is not a block-sum shortcut.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for ResolvedGroupHierarchy<C>
impl<C> RefUnwindSafe for ResolvedGroupHierarchy<C>where
C: RefUnwindSafe,
impl<C> Send for ResolvedGroupHierarchy<C>where
C: Send,
impl<C> Sync for ResolvedGroupHierarchy<C>where
C: Sync,
impl<C> Unpin for ResolvedGroupHierarchy<C>
impl<C> UnsafeUnpin for ResolvedGroupHierarchy<C>
impl<C> UnwindSafe for ResolvedGroupHierarchy<C>where
C: RefUnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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,
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.