Struct MaxParametricSolver

Source
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 or
  • omega: The omega property is of type P, which is a generic type parameter that implements the ParametricAPI trait. 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>
where R: Copy + PartialOrd + Zero + One + 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>,

Source

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: The grph parameter is a reference to a directed graph (DiGraph) with vertices of type V and edges of type R.
  • omega: The omega parameter is of type P. It represents some value or parameter that is used in the implementation of the new function. The specific meaning or purpose of omega would 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.

Source

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: dist is a mutable reference to a slice of type R. It represents a distance matrix or array, where R is the type of the elements in the matrix.
  • ratio: The ratio parameter is a mutable reference to a value of type R. 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>
where R: Copy + PartialOrd + Add<Output = R> + Sub<Output = R> + Mul<Output = R> + Div<Output = R> + Neg<Output = R> + Inv<Output = R> + Debug, V: Eq + Hash + Clone + Debug, P: ParametricAPI<V, R> + Debug,

Source§

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

Formats the value using the given formatter. Read more

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>
where P: Send, V: Sync, R: Sync,

§

impl<'a, V, R, P> Sync for MaxParametricSolver<'a, V, R, P>
where P: Sync, V: Sync, R: Sync,

§

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