pub struct StoredGraph {
pub edges: Vec<GraphEdge>,
pub node_id_width: NodeIdWidth,
pub weight_type: WeightType,
pub num_nodes: u64,
pub weighted: bool,
}Expand description
A graph collection loaded back from storage (RFC #81-P3).
Fields§
§edges: Vec<GraphEdge>Edges in stored order; weight is None for topology-only
collections. f32-stored weights are upcast to f64 losslessly
at load time.
node_id_width: NodeIdWidthStorage width used for node ids.
weight_type: WeightTypeStorage width used for the weight column (mirrors
node_id_width, #106); for topology-only collections it reports
the declared width from the dataset metadata (the F64 default
when unstamped) and is meaningful only when weighted.
num_nodes: u64Node count (from the dataset metadata; isolated vertices included).
weighted: boolWhether the edge list carries weights.
Implementations§
Source§impl StoredGraph
impl StoredGraph
Sourcepub fn to_csr(&self) -> StorageResult<CsMat<f64>>
pub fn to_csr(&self) -> StorageResult<CsMat<f64>>
Converts the edge list to a CSR matrix at the API boundary.
Topology-only graphs get weight 1.0 (unweighted convention); the
result is CsMat<f64> — weights are f64 at the API boundary, so
WeightType::F64 collections round-trip exactly.
Trait Implementations§
Source§impl Clone for StoredGraph
impl Clone for StoredGraph
Source§fn clone(&self) -> StoredGraph
fn clone(&self) -> StoredGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StoredGraph
impl Debug for StoredGraph
Source§impl PartialEq for StoredGraph
impl PartialEq for StoredGraph
impl StructuralPartialEq for StoredGraph
Auto Trait Implementations§
impl Freeze for StoredGraph
impl RefUnwindSafe for StoredGraph
impl Send for StoredGraph
impl Sync for StoredGraph
impl Unpin for StoredGraph
impl UnsafeUnpin for StoredGraph
impl UnwindSafe for StoredGraph
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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.