Struct pathfinding::directed::edmonds_karp::SparseCapacity

source ·
pub struct SparseCapacity<C> { /* private fields */ }
Expand description

Sparse capacity and flow data.

Trait Implementations§

source§

impl<C: Clone> Clone for SparseCapacity<C>

source§

fn clone(&self) -> SparseCapacity<C>

Returns a copy 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<C: Debug> Debug for SparseCapacity<C>

source§

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

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

impl<C: Copy + Zero + Signed + Eq + Ord + Bounded> EdmondsKarp<C> for SparseCapacity<C>

source§

fn new(size: usize, source: usize, sink: usize) -> Self

Create a new empty structure. Read more
source§

fn from_matrix(source: usize, sink: usize, capacities: Matrix<C>) -> Self

Create a new populated structure. Read more
source§

fn common(&self) -> &Common<C>

Common data.
source§

fn common_mut(&mut self) -> &mut Common<C>

Mutable common data.
source§

fn residual_successors(&self, from: usize) -> Vec<(usize, C)>

List of successors with positive residual capacity and this capacity.
source§

fn residual_capacity(&self, from: usize, to: usize) -> C

Residual capacity between two nodes.
source§

fn flow(&self, from: usize, to: usize) -> C

Flow between two nodes.
source§

fn flows(&self) -> Vec<((usize, usize), C)>

All flows between nodes.
source§

fn add_flow(&mut self, from: usize, to: usize, capacity: C)

Add a given flow between two nodes. This should not be used directly.
source§

fn add_residual_capacity(&mut self, from: usize, to: usize, capacity: C)

Add some residual capacity.
source§

fn flows_from(&self, n: usize) -> Vec<usize>

All positive flows starting from a node.
source§

fn from_vec(source: usize, sink: usize, capacities: Vec<C>) -> Self
where Self: Sized,

Create a new populated structure. Read more
source§

fn size(&self) -> usize

Number of nodes.
source§

fn source(&self) -> usize

Source.
source§

fn sink(&self) -> usize

Sink.
source§

fn set_capacity(&mut self, from: usize, to: usize, capacity: C)

Set capacity between two nodes.
source§

fn total_capacity(&self) -> C

Get total capacity.
source§

fn set_total_capacity(&mut self, capacity: C)

Set total capacity.
source§

fn omit_details(&mut self)

Do not request the detailed flows and cuts as a result. The returned flows and cuts will be empty vectors.
source§

fn has_details(&self) -> bool

Are detailed flows and cuts requested?
source§

fn augment(&mut self) -> EKFlows<usize, C>

Compute the maximum flow and minimum cut.
source§

impl<C: Send> Send for SparseCapacity<C>

Auto Trait Implementations§

§

impl<C> Freeze for SparseCapacity<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for SparseCapacity<C>
where C: RefUnwindSafe,

§

impl<C> Sync for SparseCapacity<C>
where C: Sync,

§

impl<C> Unpin for SparseCapacity<C>
where C: Unpin,

§

impl<C> UnwindSafe for SparseCapacity<C>

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> 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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.