pub struct MaxParametricSolver<'a, V, R, P>where
R: Copy + PartialOrd + Add<Output = R> + Sub<Output = R> + Mul<Output = R> + Div<Output = R> + Neg<Output = R> + Inv<Output = R>,
V: Eq + Hash + Clone,
P: ParametricAPI<V, R>,{ /* private fields */ }Expand description
The MaxParametricSolver struct is a generic type that takes in parameters V, R, and P and
contains a NegCycleFinder and omega of type P.
Properties:
ncf: NegCycleFinder is a struct that is used to find negative cycles in a graph. It takes three type parameters: ’a, V, and R. ’a represents the lifetime of the struct, V represents the type of the vertices in the graph, and R represents the type of the weights oromega: Theomegaproperty is of typeP, which is a generic type parameter that implements theParametricAPItrait. This trait is not defined in the code snippet you provided, so it is likely defined elsewhere in the codebase.
Implementations§
Source§impl<'a, V, R, P> MaxParametricSolver<'a, V, R, P>
impl<'a, V, R, P> MaxParametricSolver<'a, V, R, P>
Sourcepub fn new(grph: &'a DiGraph<V, R>, omega: P) -> Self
pub fn new(grph: &'a DiGraph<V, R>, omega: P) -> Self
The function creates a new instance of a struct with a given directed graph and a value.
Arguments:
grph: Thegrphparameter is a reference to a directed graph (DiGraph) with vertices of typeVand edges of typeR.omega: Theomegaparameter is of typeP. It represents some value or parameter that is used in the implementation of thenewfunction. The specific meaning or purpose ofomegawould depend on the context and the code that uses this function.
Returns:
The new function is returning an instance of the struct that it is defined in.
Sourcepub fn run(
&mut self,
dist: &mut [R],
ratio: &mut R,
) -> Vec<EdgeReference<'_, R>>
pub fn run( &mut self, dist: &mut [R], ratio: &mut R, ) -> Vec<EdgeReference<'_, R>>
The function run finds the minimum ratio and corresponding cycle in a given graph.
Arguments:
dist:distis a mutable reference to a slice of typeR. It represents a distance matrix or array, whereRis the type of the elements in the matrix.ratio: Theratioparameter is a mutable reference to a value of typeR. It represents the current ratio value that is being used in the algorithm. The algorithm will update this value if it finds a smaller ratio during its execution.
Returns:
a vector of EdgeReference<R>.
Trait Implementations§
Source§impl<'a, V, R, P> Debug for MaxParametricSolver<'a, V, R, P>
impl<'a, V, R, P> Debug for MaxParametricSolver<'a, V, R, P>
Auto Trait Implementations§
impl<'a, V, R, P> Freeze for MaxParametricSolver<'a, V, R, P>where
P: Freeze,
impl<'a, V, R, P> RefUnwindSafe for MaxParametricSolver<'a, V, R, P>
impl<'a, V, R, P> Send for MaxParametricSolver<'a, V, R, P>
impl<'a, V, R, P> Sync for MaxParametricSolver<'a, V, R, P>
impl<'a, V, R, P> Unpin for MaxParametricSolver<'a, V, R, P>where
P: Unpin,
impl<'a, V, R, P> UnwindSafe for MaxParametricSolver<'a, V, R, P>
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