pub struct CsrSortedGraph<DCF = Box<[usize]>, S = Box<[usize]>>(/* private fields */);Expand description
A wrapper for a CsrGraph with the additional guarantee that the
successors are sorted.
Implementations§
Source§impl CsrSortedGraph
impl CsrSortedGraph
Sourcepub fn from_lender<I: IntoLender>(iter_nodes: I) -> Selfwhere
I::Lender: for<'next> NodeLabelsLender<'next, Label = usize> + SortedLender,
for<'succ> LenderIntoIter<'succ, I::Lender>: SortedIterator,
pub fn from_lender<I: IntoLender>(iter_nodes: I) -> Selfwhere
I::Lender: for<'next> NodeLabelsLender<'next, Label = usize> + SortedLender,
for<'succ> LenderIntoIter<'succ, I::Lender>: SortedIterator,
Creates a new sorted CSR graph from an IntoLender yielding a sorted
NodeLabelsLender with sorted successors.
Sourcepub fn from_seq_graph<G: SequentialGraph>(g: &G) -> Selfwhere
for<'a> G::Lender<'a>: SortedLender,
for<'a, 'b> LenderIntoIter<'b, G::Lender<'a>>: SortedIterator,
pub fn from_seq_graph<G: SequentialGraph>(g: &G) -> Selfwhere
for<'a> G::Lender<'a>: SortedLender,
for<'a, 'b> LenderIntoIter<'b, G::Lender<'a>>: SortedIterator,
Creates a new sorted CSR graph from a SequentialGraph with
sorted lenders and sorted successors.
Source§impl CsrSortedGraph<EliasFano<SelectAdaptConst<BitVec<Box<[usize]>>, Box<[usize]>, 12, 4>>, BitFieldVec>
impl CsrSortedGraph<EliasFano<SelectAdaptConst<BitVec<Box<[usize]>>, Box<[usize]>, 12, 4>>, BitFieldVec>
Sourcepub fn try_from_graph<G: SequentialGraph>(g: &G) -> Result<Self>where
for<'a> G::Lender<'a>: SortedLender,
for<'a, 'b> LenderIntoIter<'b, G::Lender<'a>>: SortedIterator,
pub fn try_from_graph<G: SequentialGraph>(g: &G) -> Result<Self>where
for<'a> G::Lender<'a>: SortedLender,
for<'a, 'b> LenderIntoIter<'b, G::Lender<'a>>: SortedIterator,
Creates a new compressed CSR sorted graph from a sequential graph with sorted lender, sorted successors, and providing the number of arcs.
This method will return an error if the graph does not provide the number of arcs.
Trait Implementations§
Source§impl<DCF, S> AlignHash for CsrSortedGraph<DCF, S>
impl<DCF, S> AlignHash for CsrSortedGraph<DCF, S>
Source§fn align_hash(hasher: &mut impl Hasher, offset_of: &mut usize)
fn align_hash(hasher: &mut impl Hasher, offset_of: &mut usize)
Accumulates alignment information in
hasher assuming to be positioned
at offset_of.Source§fn align_hash_val(&self, hasher: &mut impl Hasher, offset_of: &mut usize)
fn align_hash_val(&self, hasher: &mut impl Hasher, offset_of: &mut usize)
Calls
AlignHash::align_hash on a value.Source§impl<DCF: Clone, S: Clone> Clone for CsrSortedGraph<DCF, S>
impl<DCF: Clone, S: Clone> Clone for CsrSortedGraph<DCF, S>
Source§fn clone(&self) -> CsrSortedGraph<DCF, S>
fn clone(&self) -> CsrSortedGraph<DCF, S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<DCF, S> DeserInner for CsrSortedGraph<DCF, S>where
CsrGraph<DCF, S>: DeserInner,
impl<DCF, S> DeserInner for CsrSortedGraph<DCF, S>where
CsrGraph<DCF, S>: DeserInner,
Source§type DeserType<'__epserde_desertype> = CsrSortedGraph<DCF, S>
type DeserType<'__epserde_desertype> = CsrSortedGraph<DCF, S>
The deserialization type associated with this type. It can be retrieved
conveniently with the alias
DeserType.Source§fn __check_covariance<'__long: '__short, '__short>(
proof: CovariantProof<Self::DeserType<'__long>>,
) -> CovariantProof<Self::DeserType<'__short>>
fn __check_covariance<'__long: '__short, '__short>( proof: CovariantProof<Self::DeserType<'__long>>, ) -> CovariantProof<Self::DeserType<'__short>>
Source§unsafe fn _deser_full_inner(
backend: &mut impl ReadWithPos,
) -> Result<Self, Error>
unsafe fn _deser_full_inner( backend: &mut impl ReadWithPos, ) -> Result<Self, Error>
Safety Read more
Source§unsafe fn _deser_eps_inner<'deser_eps_inner_lifetime>(
backend: &mut SliceWithPos<'deser_eps_inner_lifetime>,
) -> Result<Self::DeserType<'deser_eps_inner_lifetime>, Error>
unsafe fn _deser_eps_inner<'deser_eps_inner_lifetime>( backend: &mut SliceWithPos<'deser_eps_inner_lifetime>, ) -> Result<Self::DeserType<'deser_eps_inner_lifetime>, Error>
Safety Read more
Source§impl<'a, DCF, S> IntoLender for &'a CsrSortedGraph<DCF, S>where
DCF: SliceByValue + IterateByValueFrom<Item = usize>,
S: SliceByValue + IterateByValueFrom<Item = usize>,
Convenience implementation that makes it possible to iterate
over the graph using the for_ macro
(see the crate documentation).
impl<'a, DCF, S> IntoLender for &'a CsrSortedGraph<DCF, S>where
DCF: SliceByValue + IterateByValueFrom<Item = usize>,
S: SliceByValue + IterateByValueFrom<Item = usize>,
Convenience implementation that makes it possible to iterate
over the graph using the for_ macro
(see the crate documentation).
Source§type Lender = <&'a CsrSortedGraph<DCF, S> as SequentialLabeling>::Lender<'a>
type Lender = <&'a CsrSortedGraph<DCF, S> as SequentialLabeling>::Lender<'a>
The lender type that this type converts into.
Source§fn into_lender(self) -> Self::Lender
fn into_lender(self) -> Self::Lender
Converts this type into a
Lender.Source§impl<DCF, S> RandomAccessGraph for CsrSortedGraph<DCF, S>where
DCF: SliceByValue<Value = usize> + IterateByValueFrom<Item = usize>,
S: SliceByValue<Value = usize> + IterateByValueFrom<Item = usize>,
impl<DCF, S> RandomAccessGraph for CsrSortedGraph<DCF, S>where
DCF: SliceByValue<Value = usize> + IterateByValueFrom<Item = usize>,
S: SliceByValue<Value = usize> + IterateByValueFrom<Item = usize>,
Source§impl<DCF, S> RandomAccessLabeling for CsrSortedGraph<DCF, S>where
DCF: SliceByValue<Value = usize> + IterateByValueFrom<Item = usize>,
S: SliceByValue<Value = usize> + IterateByValueFrom<Item = usize>,
impl<DCF, S> RandomAccessLabeling for CsrSortedGraph<DCF, S>where
DCF: SliceByValue<Value = usize> + IterateByValueFrom<Item = usize>,
S: SliceByValue<Value = usize> + IterateByValueFrom<Item = usize>,
Source§impl<DCF, S> SequentialLabeling for CsrSortedGraph<DCF, S>where
DCF: SliceByValue + IterateByValueFrom<Item = usize>,
S: SliceByValue + IterateByValueFrom<Item = usize>,
impl<DCF, S> SequentialLabeling for CsrSortedGraph<DCF, S>where
DCF: SliceByValue + IterateByValueFrom<Item = usize>,
S: SliceByValue + IterateByValueFrom<Item = usize>,
type Label = usize
Source§type Lender<'a> = LenderSortedImpl<<DCF as IterateByValueFromGat<'a>>::IterFrom, <S as IterateByValueFromGat<'a>>::IterFrom>
where
Self: 'a
type Lender<'a> = LenderSortedImpl<<DCF as IterateByValueFromGat<'a>>::IterFrom, <S as IterateByValueFromGat<'a>>::IterFrom> where Self: 'a
Source§fn num_arcs_hint(&self) -> Option<u64>
fn num_arcs_hint(&self) -> Option<u64>
Returns the number of arcs in the graph, if available.
Source§fn iter_from(&self, from: usize) -> Self::Lender<'_>
fn iter_from(&self, from: usize) -> Self::Lender<'_>
Returns an iterator over the labeling starting at
from (included). Read moreSource§fn par_node_apply<A: Default + Send, F: Fn(Range<usize>) -> A + Sync, R: Fn(A, A) -> A + Sync>(
&self,
func: F,
fold: R,
granularity: Granularity,
pl: &mut impl ConcurrentProgressLog,
) -> A
fn par_node_apply<A: Default + Send, F: Fn(Range<usize>) -> A + Sync, R: Fn(A, A) -> A + Sync>( &self, func: F, fold: R, granularity: Granularity, pl: &mut impl ConcurrentProgressLog, ) -> A
Applies
func to each chunk of nodes of size node_granularity in
parallel, and folds the results using fold. Read moreSource§fn par_apply<F: Fn(Range<usize>) -> A + Sync, A: Default + Send, R: Fn(A, A) -> A + Sync, D: for<'a> Succ<Input = usize, Output<'a> = usize>>(
&self,
func: F,
fold: R,
granularity: Granularity,
deg_cumul: &D,
pl: &mut impl ConcurrentProgressLog,
) -> A
fn par_apply<F: Fn(Range<usize>) -> A + Sync, A: Default + Send, R: Fn(A, A) -> A + Sync, D: for<'a> Succ<Input = usize, Output<'a> = usize>>( &self, func: F, fold: R, granularity: Granularity, deg_cumul: &D, pl: &mut impl ConcurrentProgressLog, ) -> A
Applies
func to each chunk of nodes containing approximately
arc_granularity arcs in parallel and folds the results using fold. Read moreSource§impl<DCF, S> SerInner for CsrSortedGraph<DCF, S>
impl<DCF, S> SerInner for CsrSortedGraph<DCF, S>
Source§const IS_ZERO_COPY: bool
const IS_ZERO_COPY: bool
Inner constant used by the derive macros to keep
track recursively of whether the type
satisfies the conditions for being zero-copy. It is checked
at runtime against the trait implemented by the type, and
if a
ZeroCopy type has this constant set to false
serialization will panic.Source§type SerType = CsrSortedGraph<DCF, S>
type SerType = CsrSortedGraph<DCF, S>
This is the type that will be written in the header of the file, and
thus the type that will be deserialized. In most cases it is
Self, but
in some cases, as for references to slices,
it is customized.Source§unsafe fn _ser_inner(&self, backend: &mut impl WriteWithNames) -> Result<()>
unsafe fn _ser_inner(&self, backend: &mut impl WriteWithNames) -> Result<()>
Serializes this structure using the given backend. Read more
Source§impl<DCF, S> TypeHash for CsrSortedGraph<DCF, S>
impl<DCF, S> TypeHash for CsrSortedGraph<DCF, S>
Source§fn type_hash_val(&self, hasher: &mut impl Hasher)
fn type_hash_val(&self, hasher: &mut impl Hasher)
Calls
TypeHash::type_hash on a value.impl<D, S> SequentialGraph for CsrSortedGraph<D, S>where
D: SliceByValue + IterateByValueFrom<Item = usize>,
S: SliceByValue + IterateByValueFrom<Item = usize>,
Auto Trait Implementations§
impl<DCF, S> Freeze for CsrSortedGraph<DCF, S>
impl<DCF, S> RefUnwindSafe for CsrSortedGraph<DCF, S>where
DCF: RefUnwindSafe,
S: RefUnwindSafe,
impl<DCF, S> Send for CsrSortedGraph<DCF, S>
impl<DCF, S> Sync for CsrSortedGraph<DCF, S>
impl<DCF, S> Unpin for CsrSortedGraph<DCF, S>
impl<DCF, S> UnsafeUnpin for CsrSortedGraph<DCF, S>where
DCF: UnsafeUnpin,
S: UnsafeUnpin,
impl<DCF, S> UnwindSafe for CsrSortedGraph<DCF, S>where
DCF: UnwindSafe,
S: UnwindSafe,
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
Source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Truncate the current UnsignedInt to a possibly smaller size
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
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>
Converts
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>
Converts
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> UpcastableFrom<T> for T
impl<T> UpcastableFrom<T> for T
Source§fn upcast_from(value: T) -> T
fn upcast_from(value: T) -> T
Extend the current UnsignedInt to a possibly bigger size.