pub struct SparseWeights<'view, A, T, Id, I, P>{ /* private fields */ }Expand description
Selected sparse primitive weights bound to one axis of a topology view.
A is one of ElementAxis, RelationAxis, or IncidenceAxis;
the per-axis new constructor selects the right topology bound.
§Performance
Weight lookup is O(log k) for k explicitly stored values.
Implementations§
Source§impl<'view, A, T, Id, I, P> SparseWeights<'view, A, T, Id, I, P>
impl<'view, A, T, Id, I, P> SparseWeights<'view, A, T, Id, I, P>
Sourcepub fn new(
topology: &'view T,
layer: &'view PropertyLayer<Id, I>,
) -> Result<Self, PropertyError>
pub fn new( topology: &'view T, layer: &'view PropertyLayer<Id, I>, ) -> Result<Self, PropertyError>
Selects a sparse primitive layer as total weights for topology
along axis A (ElementAxis, RelationAxis, or
IncidenceAxis).
§Errors
Returns PropertyError when the sparse layer is not total or
type-compatible.
§Performance
Validation is O(1) plus default downcast.
Trait Implementations§
Source§impl<T, Id, I, P> ElementWeight for SparseWeights<'_, ElementAxis, T, Id, I, P>
impl<T, Id, I, P> ElementWeight for SparseWeights<'_, ElementAxis, T, Id, I, P>
Source§impl<T, Id, I, P> IncidenceBase for SparseWeights<'_, IncidenceAxis, T, Id, I, P>
impl<T, Id, I, P> IncidenceBase for SparseWeights<'_, IncidenceAxis, T, Id, I, P>
Source§type IncidenceId = <T as IncidenceBase>::IncidenceId
type IncidenceId = <T as IncidenceBase>::IncidenceId
Identity of one element’s participation in one relation. Read more
Source§impl<T, Id, I, P> IncidenceWeight for SparseWeights<'_, IncidenceAxis, T, Id, I, P>
impl<T, Id, I, P> IncidenceWeight for SparseWeights<'_, IncidenceAxis, T, Id, I, P>
Source§type Weight = <P as ArrowPrimitiveType>::Native
type Weight = <P as ArrowPrimitiveType>::Native
Copyable weight representation attached to each visible incidence. Read more
Source§fn incidence_weight(&self, id: Self::IncidenceId) -> Self::Weight
fn incidence_weight(&self, id: Self::IncidenceId) -> Self::Weight
Returns the weight attached to
incidence. Read moreSource§impl<T, Id, I, P> RelationWeight for SparseWeights<'_, RelationAxis, T, Id, I, P>
impl<T, Id, I, P> RelationWeight for SparseWeights<'_, RelationAxis, T, Id, I, P>
Source§type Weight = <P as ArrowPrimitiveType>::Native
type Weight = <P as ArrowPrimitiveType>::Native
Copyable weight representation attached to each visible relation. Read more
Source§fn relation_weight(&self, id: Self::RelationId) -> Self::Weight
fn relation_weight(&self, id: Self::RelationId) -> Self::Weight
Returns the weight attached to
relation. Read moreSource§impl<T, Id, I, P> TopologyBase for SparseWeights<'_, ElementAxis, T, Id, I, P>
impl<T, Id, I, P> TopologyBase for SparseWeights<'_, ElementAxis, T, Id, I, P>
Source§type RelationId = <T as TopologyBase>::RelationId
type RelationId = <T as TopologyBase>::RelationId
Identity of a topology relation. Read more
Source§impl<T, Id, I, P> TopologyBase for SparseWeights<'_, IncidenceAxis, T, Id, I, P>
impl<T, Id, I, P> TopologyBase for SparseWeights<'_, IncidenceAxis, T, Id, I, P>
Source§type RelationId = <T as TopologyBase>::RelationId
type RelationId = <T as TopologyBase>::RelationId
Identity of a topology relation. Read more
Source§impl<T, Id, I, P> TopologyBase for SparseWeights<'_, RelationAxis, T, Id, I, P>
impl<T, Id, I, P> TopologyBase for SparseWeights<'_, RelationAxis, T, Id, I, P>
Source§type RelationId = <T as TopologyBase>::RelationId
type RelationId = <T as TopologyBase>::RelationId
Identity of a topology relation. Read more
Auto Trait Implementations§
impl<'view, A, T, Id, I, P> Freeze for SparseWeights<'view, A, T, Id, I, P>
impl<'view, A, T, Id, I, P> RefUnwindSafe for SparseWeights<'view, A, T, Id, I, P>where
<P as ArrowPrimitiveType>::Native: RefUnwindSafe,
T: RefUnwindSafe,
A: RefUnwindSafe,
Id: RefUnwindSafe,
I: RefUnwindSafe,
impl<'view, A, T, Id, I, P> Send for SparseWeights<'view, A, T, Id, I, P>
impl<'view, A, T, Id, I, P> Sync for SparseWeights<'view, A, T, Id, I, P>
impl<'view, A, T, Id, I, P> Unpin for SparseWeights<'view, A, T, Id, I, P>
impl<'view, A, T, Id, I, P> UnsafeUnpin for SparseWeights<'view, A, T, Id, I, P>
impl<'view, A, T, Id, I, P> UnwindSafe for SparseWeights<'view, A, T, Id, I, P>where
<P as ArrowPrimitiveType>::Native: UnwindSafe + RefUnwindSafe,
T: RefUnwindSafe,
A: UnwindSafe,
Id: UnwindSafe,
I: RefUnwindSafe,
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