pub struct NetworkData { /* private fields */ }Expand description
Tabular unit data paired with a fixed, row-indexed network.
Incoming adjacency is stored CSR-style: one edge array sorted by
(to, from) plus an offsets table, so construction is two allocations
(the array-of-Arcs layout it replaces made n + 1, most of them empty)
and incoming(unit) is a contiguous slice.
Implementations§
Source§impl NetworkData
impl NetworkData
Sourcepub fn try_new(
units: TabularData,
edges: impl Into<Arc<[NetworkEdge]>>,
) -> Result<Self, DataError>
pub fn try_new( units: TabularData, edges: impl Into<Arc<[NetworkEdge]>>, ) -> Result<Self, DataError>
Build a network, validating row indexes, weights, self-edges, and duplicates.
§Errors
DataError::InvalidArgument when an edge is invalid for the unit table.
Sourcepub const fn units(&self) -> &TabularData
pub const fn units(&self) -> &TabularData
Borrow unit-level columns.
Sourcepub fn edges(&self) -> &[NetworkEdge]
pub fn edges(&self) -> &[NetworkEdge]
Borrow all directed network edges.
Sourcepub fn incoming(&self, unit: usize) -> Result<&[NetworkEdge], DataError>
pub fn incoming(&self, unit: usize) -> Result<&[NetworkEdge], DataError>
Incoming neighbors whose assignments define exposure for unit.
§Errors
DataError::InvalidArgument when unit is outside the table.
Trait Implementations§
Source§impl Clone for NetworkData
impl Clone for NetworkData
Source§fn clone(&self) -> NetworkData
fn clone(&self) -> NetworkData
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for NetworkData
impl !UnwindSafe for NetworkData
impl Freeze for NetworkData
impl Send for NetworkData
impl Sync for NetworkData
impl Unpin for NetworkData
impl UnsafeUnpin for NetworkData
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