Struct pathfinding::DenseCapacity
[−]
[src]
pub struct DenseCapacity<C> { /* fields omitted */ }
Dense capacity and flow data.
Methods
impl<C: Clone + Zero> DenseCapacity<C>
[src]
fn new(size: usize, source: usize, sink: usize) -> DenseCapacity<C>
[src]
Create a new dense structure.
Panics
This function panics when source
or sink
is greater or equal than size
.
fn from_matrix(
source: usize,
sink: usize,
capacities: SquareMatrix<C>
) -> DenseCapacity<C>
[src]
source: usize,
sink: usize,
capacities: SquareMatrix<C>
) -> DenseCapacity<C>
Create a new dense structure.
Panics
This function panics when source
or sink
is greater or equal than the
number of rows in the capacities
matrix.
fn from_vec(source: usize, sink: usize, data: Vec<C>) -> DenseCapacity<C>
[src]
Create a new dense structure.
Panics
This function panics when source
or sink
is greater or equal than the
number of rows of the newly created square capacities matrix, or when the
data is not square.
Trait Implementations
impl<C: Debug> Debug for DenseCapacity<C>
[src]
impl<C: Clone + Zero + Signed + PartialOrd + Bounded> EdmondsKarp<C> for DenseCapacity<C>
[src]
fn common(&self) -> &Common<C>
[src]
Common data.
fn common_mut(&mut self) -> &mut Common<C>
[src]
Mutable common data.
fn residual_neighbours(&self, from: usize) -> Vec<(usize, C)>
[src]
List of neighbours with positive residual capacity and this capacity.
fn residual_capacity(&self, from: usize, to: usize) -> C
[src]
Residual capacity between two nodes.
fn flow(&self, from: usize, to: usize) -> C
[src]
Flow between two nodes.
fn flows(&self) -> Vec<((usize, usize), C)>
[src]
All flows between nodes.
fn set_capacity(&mut self, from: usize, to: usize, capacity: C)
[src]
Set capacity between two nodes. This might trigger a reset of the already computed flows. Read more
fn add_flow(&mut self, from: usize, to: usize, capacity: C)
[src]
Add a given flow between two nodes. This should not be used directly. Read more
fn reset_if_needed(&mut self)
[src]
Reset the flows if needed.
fn size(&self) -> usize
[src]
Number of nodes.
fn source(&self) -> usize
[src]
Source.
fn sink(&self) -> usize
[src]
Sink.
fn total_capacity(&self) -> C
[src]
Get total capacity.
fn set_total_capacity(&mut self, capacity: C)
[src]
Set total capacity.
fn omit_detailed_flows(&mut self)
[src]
Do not request the detailed flows as a result. The returned flows will be an empty vector. Read more
fn detailed_flows(&self) -> bool
[src]
Are detailed flows requested?
fn augment(&mut self) -> EKFlows<usize, C>
[src]
Compute the maximum flow.