pub struct Zip<L: SequentialLabeling, R: SequentialLabeling>(pub L, pub R);Expand description
Zips together two labelings.
A wrapper tuple struct that zips together two labelings, and provides in return a labeling on pairs. It can be used simply to combine labelings over the same graph, but, more importantly, to attach a labeling to a graph, obtaining a labeled graph. Depending on the traits implemented by the two component labelings, the resulting labeling will be sequential or random-access.
Note that the two labelings should be on the same graph: a debug_assert!
will check if two sequential iterators have the same length and return nodes in the
same order, but no such check is possible for labels as we use Iterator::zip,
which does not perform length checks. For extra safety, consider using
Zip::verify to perform a complete scan of the two labelings.
Tuple Fields§
§0: L§1: RImplementations§
Source§impl<L: SequentialLabeling, R: SequentialLabeling> Zip<L, R>
impl<L: SequentialLabeling, R: SequentialLabeling> Zip<L, R>
Sourcepub fn verify(&self) -> bool
pub fn verify(&self) -> bool
Performs a complete scan of the content of the two component labelings, returning true if they are compatible, that is, their iterators have the same length and return nodes in the same order, and the two iterators paired to each node return the same number of elements.
Trait Implementations§
Source§impl<L: Clone + SequentialLabeling, R: Clone + SequentialLabeling> Clone for Zip<L, R>
impl<L: Clone + SequentialLabeling, R: Clone + SequentialLabeling> Clone for Zip<L, R>
Source§impl<L: Debug + SequentialLabeling, R: Debug + SequentialLabeling> Debug for Zip<L, R>
impl<L: Debug + SequentialLabeling, R: Debug + SequentialLabeling> Debug for Zip<L, R>
Source§impl<'a, L: SequentialLabeling, R: SequentialLabeling> IntoLender for &'a Zip<L, R>
impl<'a, L: SequentialLabeling, R: SequentialLabeling> IntoLender for &'a Zip<L, R>
Source§impl<G: RandomAccessGraph, L: RandomAccessLabeling> LabeledRandomAccessGraph<<L as SequentialLabeling>::Label> for Zip<G, L>
impl<G: RandomAccessGraph, L: RandomAccessLabeling> LabeledRandomAccessGraph<<L as SequentialLabeling>::Label> for Zip<G, L>
Source§impl<L: Ord + SequentialLabeling, R: Ord + SequentialLabeling> Ord for Zip<L, R>
impl<L: Ord + SequentialLabeling, R: Ord + SequentialLabeling> Ord for Zip<L, R>
Source§impl<L: PartialEq + SequentialLabeling, R: PartialEq + SequentialLabeling> PartialEq for Zip<L, R>
impl<L: PartialEq + SequentialLabeling, R: PartialEq + SequentialLabeling> PartialEq for Zip<L, R>
Source§impl<L: PartialOrd + SequentialLabeling, R: PartialOrd + SequentialLabeling> PartialOrd for Zip<L, R>
impl<L: PartialOrd + SequentialLabeling, R: PartialOrd + SequentialLabeling> PartialOrd for Zip<L, R>
Source§impl<L: RandomAccessLabeling, R: RandomAccessLabeling> RandomAccessLabeling for Zip<L, R>
impl<L: RandomAccessLabeling, R: RandomAccessLabeling> RandomAccessLabeling for Zip<L, R>
Source§type Labels<'succ> = Zip<<<L as RandomAccessLabeling>::Labels<'succ> as IntoIterator>::IntoIter, <<R as RandomAccessLabeling>::Labels<'succ> as IntoIterator>::IntoIter>
where
<L as RandomAccessLabeling>::Labels<'succ>: IntoIterator<Item = <L as SequentialLabeling>::Label>,
<R as RandomAccessLabeling>::Labels<'succ>: IntoIterator<Item = <R as SequentialLabeling>::Label>,
Self: 'succ
type Labels<'succ> = Zip<<<L as RandomAccessLabeling>::Labels<'succ> as IntoIterator>::IntoIter, <<R as RandomAccessLabeling>::Labels<'succ> as IntoIterator>::IntoIter> where <L as RandomAccessLabeling>::Labels<'succ>: IntoIterator<Item = <L as SequentialLabeling>::Label>, <R as RandomAccessLabeling>::Labels<'succ>: IntoIterator<Item = <R as SequentialLabeling>::Label>, Self: 'succ
labels.Source§impl<L: SequentialLabeling, R: SequentialLabeling> SequentialLabeling for Zip<L, R>
impl<L: SequentialLabeling, R: SequentialLabeling> SequentialLabeling for Zip<L, R>
type Label = (<L as SequentialLabeling>::Label, <R as SequentialLabeling>::Label)
Source§type Lender<'node> = NodeLabels<<L as SequentialLabeling>::Lender<'node>, <R as SequentialLabeling>::Lender<'node>>
where
Self: 'node
type Lender<'node> = NodeLabels<<L as SequentialLabeling>::Lender<'node>, <R as SequentialLabeling>::Lender<'node>> where Self: 'node
Source§fn iter_from(&self, from: usize) -> Self::Lender<'_>
fn iter_from(&self, from: usize) -> Self::Lender<'_>
from (included). Read moreSource§fn num_arcs_hint(&self) -> Option<u64>
fn num_arcs_hint(&self) -> Option<u64>
Source§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
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
func to each chunk of nodes containing approximately
arc_granularity arcs in parallel and folds the results using fold. Read moreimpl<L: Eq + SequentialLabeling, R: Eq + SequentialLabeling> Eq for Zip<L, R>
impl<G: SequentialGraph, L: SequentialLabeling> LabeledSequentialGraph<<L as SequentialLabeling>::Label> for Zip<G, L>
impl<L: SequentialLabeling, R: SequentialLabeling> StructuralPartialEq for Zip<L, R>
Auto Trait Implementations§
impl<L, R> Freeze for Zip<L, R>
impl<L, R> RefUnwindSafe for Zip<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Zip<L, R>
impl<L, R> Sync for Zip<L, R>
impl<L, R> Unpin for Zip<L, R>
impl<L, R> UnsafeUnpin for Zip<L, R>where
L: UnsafeUnpin,
R: UnsafeUnpin,
impl<L, R> UnwindSafe for Zip<L, R>where
L: UnwindSafe,
R: 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
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
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 more