pub enum WeightType {
F64,
F32,
}Expand description
Edge-weight storage width of a graph collection, mirroring
NodeIdWidth (#106): the width is schema-declared through
GraphWriteOptions::weight_type, resolving the RFC #81 open
question (“Float64 only, or allow Float32?”) with “both,
schema-declared”.
Variants§
F64
Float64 weights (default): the same width and exactness as the
value column of the legacy sparse-matrix artifacts, so an f64
CSR (laplacian, adjacency) round-trips bit-identically through
the graph API just like through save_sparse.
F32
Float32 weights (opt-in): half the storage bytes for
memory-bound consumers. Weights that cannot be represented exactly
at this width are rejected on save instead of being silently
narrowed; finite values beyond the f32 range surface
StorageError::Overflow (#51). Infinities narrow bit-exactly;
NaN is preserved as NaN (classification semantics only — the
payload is not guaranteed bit-exact, unlike the
WeightType::F64 width).
Implementations§
Source§impl WeightType
impl WeightType
Trait Implementations§
Source§impl Clone for WeightType
impl Clone for WeightType
Source§fn clone(&self) -> WeightType
fn clone(&self) -> WeightType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WeightType
Source§impl Debug for WeightType
impl Debug for WeightType
impl Eq for WeightType
Source§impl PartialEq for WeightType
impl PartialEq for WeightType
impl StructuralPartialEq for WeightType
Auto Trait Implementations§
impl Freeze for WeightType
impl RefUnwindSafe for WeightType
impl Send for WeightType
impl Sync for WeightType
impl Unpin for WeightType
impl UnsafeUnpin for WeightType
impl UnwindSafe for WeightType
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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
Source§impl<T> RLE for T
impl<T> RLE 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.