Skip to main content

Zip

Struct Zip 

Source
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: R

Implementations§

Source§

impl<L: SequentialLabeling, R: SequentialLabeling> Zip<L, R>

Source

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>

Source§

fn clone(&self) -> Zip<L, R>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<L: Debug + SequentialLabeling, R: Debug + SequentialLabeling> Debug for Zip<L, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, L: SequentialLabeling, R: SequentialLabeling> IntoLender for &'a Zip<L, R>

Source§

type Lender = <Zip<L, R> as SequentialLabeling>::Lender<'a>

The lender type that this type converts into.
Source§

fn into_lender(self) -> Self::Lender

Converts this type into a Lender.
Source§

impl<G: RandomAccessGraph, L: RandomAccessLabeling> LabeledRandomAccessGraph<<L as SequentialLabeling>::Label> for Zip<G, L>

Source§

fn successors( &self, node_id: usize, ) -> <Self as RandomAccessLabeling>::Labels<'_>

Returns pairs given by successors of a node and their labels. Read more
Source§

fn has_arc(&self, src: usize, dst: usize) -> bool

Returns whether there is an arc going from src_node_id to dst_node_id. Read more
Source§

impl<L: Ord + SequentialLabeling, R: Ord + SequentialLabeling> Ord for Zip<L, R>

Source§

fn cmp(&self, other: &Zip<L, R>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<L: PartialEq + SequentialLabeling, R: PartialEq + SequentialLabeling> PartialEq for Zip<L, R>

Source§

fn eq(&self, other: &Zip<L, R>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<L: PartialOrd + SequentialLabeling, R: PartialOrd + SequentialLabeling> PartialOrd for Zip<L, R>

Source§

fn partial_cmp(&self, other: &Zip<L, R>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

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

The type of the iterator over the labels of a node returned by labels.
Source§

fn num_arcs(&self) -> u64

Returns the number of arcs in the graph.
Source§

fn labels(&self, node_id: usize) -> <Self as RandomAccessLabeling>::Labels<'_>

Returns the labels associated with a node.
Source§

fn outdegree(&self, _node_id: usize) -> usize

Returns the number of labels associated with a node.
Source§

impl<L: SequentialLabeling, R: SequentialLabeling> SequentialLabeling for Zip<L, R>

Source§

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

The type of Lender over the successors of a node returned by iter.
Source§

fn num_nodes(&self) -> usize

Returns the number of nodes in the graph.
Source§

fn iter_from(&self, from: usize) -> Self::Lender<'_>

Returns an iterator over the labeling starting at from (included). Read more
Source§

fn num_arcs_hint(&self) -> Option<u64>

Returns the number of arcs in the graph, if available.
Source§

fn iter(&self) -> Self::Lender<'_>

Returns an iterator over the labeling. Read more
Source§

fn build_dcf(&self) -> DCF

Builds the degree cumulative function for this labeling. Read more
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

Applies func to each chunk of nodes of size node_granularity in parallel, and folds the results using fold. Read more
Source§

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 more
Source§

impl<L: Eq + SequentialLabeling, R: Eq + SequentialLabeling> Eq for Zip<L, R>

Source§

impl<G: SequentialGraph, L: SequentialLabeling> LabeledSequentialGraph<<L as SequentialLabeling>::Label> for Zip<G, L>

Source§

impl<L: SequentialLabeling, R: SequentialLabeling> StructuralPartialEq for Zip<L, R>

Auto Trait Implementations§

§

impl<L, R> Freeze for Zip<L, R>
where L: Freeze, R: Freeze,

§

impl<L, R> RefUnwindSafe for Zip<L, R>

§

impl<L, R> Send for Zip<L, R>
where L: Send, R: Send,

§

impl<L, R> Sync for Zip<L, R>
where L: Sync, R: Sync,

§

impl<L, R> Unpin for Zip<L, R>
where L: Unpin, R: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CastableFrom<T> for T

Source§

fn cast_from(value: T) -> T

Call Self as W
Source§

impl<T, U> CastableInto<U> for T
where U: CastableFrom<T>,

Source§

fn cast(self) -> U

Call W::cast_from(self)
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> DowncastableFrom<T> for T

Source§

fn downcast_from(value: T) -> T

Truncate the current UnsignedInt to a possibly smaller size
Source§

impl<T, U> DowncastableInto<U> for T
where U: DowncastableFrom<T>,

Source§

fn downcast(self) -> U

Call W::downcast_from(self)
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Splat<T> for T

Source§

fn splat(value: T) -> T

Source§

impl<T> To<T> for T

Source§

fn to(self) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UpcastableFrom<T> for T

Source§

fn upcast_from(value: T) -> T

Extend the current UnsignedInt to a possibly bigger size.
Source§

impl<T, U> UpcastableInto<U> for T
where U: UpcastableFrom<T>,

Source§

fn upcast(self) -> U

Call W::upcast_from(self)
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V