Skip to main content

SparseWeights

Struct SparseWeights 

Source
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>

Source

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>

Source§

type Weight = <P as ArrowPrimitiveType>::Native

Copyable weight representation attached to each visible element. Read more
Source§

fn element_weight(&self, element: Self::ElementId) -> Self::Weight

Returns the weight attached to element. Read more
Source§

impl<T, Id, I, P> IncidenceBase for SparseWeights<'_, IncidenceAxis, T, Id, I, P>

Source§

type IncidenceId = <T as IncidenceBase>::IncidenceId

Identity of one element’s participation in one relation. Read more
Source§

type Role = <T as IncidenceBase>::Role

Implementation-defined participation role. Read more
Source§

impl<T, Id, I, P> IncidenceWeight for SparseWeights<'_, IncidenceAxis, T, Id, I, P>

Source§

type Weight = <P as ArrowPrimitiveType>::Native

Copyable weight representation attached to each visible incidence. Read more
Source§

fn incidence_weight(&self, incidence: Self::IncidenceId) -> Self::Weight

Returns the weight attached to incidence. Read more
Source§

impl<T, Id, I, P> RelationWeight for SparseWeights<'_, RelationAxis, T, Id, I, P>

Source§

type Weight = <P as ArrowPrimitiveType>::Native

Copyable weight representation attached to each visible relation. Read more
Source§

fn relation_weight(&self, relation: Self::RelationId) -> Self::Weight

Returns the weight attached to relation. Read more
Source§

impl<T, Id, I, P> TopologyBase for SparseWeights<'_, ElementAxis, T, Id, I, P>

Source§

type ElementId = <T as TopologyBase>::ElementId

Identity of a topology element. Read more
Source§

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>

Source§

type ElementId = <T as TopologyBase>::ElementId

Identity of a topology element. Read more
Source§

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>

Source§

type ElementId = <T as TopologyBase>::ElementId

Identity of a topology element. Read more
Source§

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>

§

impl<'view, A, T, Id, I, P> Send for SparseWeights<'view, A, T, Id, I, P>
where T: Sync, A: Send, Id: Send, I: Sync,

§

impl<'view, A, T, Id, I, P> Sync for SparseWeights<'view, A, T, Id, I, P>
where T: Sync, A: Sync, Id: Sync, I: Sync,

§

impl<'view, A, T, Id, I, P> Unpin for SparseWeights<'view, A, T, Id, I, P>
where <P as ArrowPrimitiveType>::Native: Unpin, A: Unpin, Id: Unpin,

§

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>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,