pub struct LinearIntegerExpr<T: Display + Debug + Clone> {
pairs: Vec<AtomFactorPair<T>>,
}Expand description
Type to represent a linear arithmetic expression
Fields§
§pairs: Vec<AtomFactorPair<T>>Pairs part of a sum
Implementations§
Source§impl<T: Display + Debug + Clone> LinearIntegerExpr<T>
impl<T: Display + Debug + Clone> LinearIntegerExpr<T>
Sourcepub fn get_const_factor(&self) -> Fraction
pub fn get_const_factor(&self) -> Fraction
Get the constant factor of the expression
For an expression of the form a * x + b * y + p * z + c, where a, b
and p are coefficients and x,y,z are parameters and c a constant,
this function returns c.
Sourcepub fn get_atom_factor_pairs(&self) -> impl Iterator<Item = (&T, &Fraction)>
pub fn get_atom_factor_pairs(&self) -> impl Iterator<Item = (&T, &Fraction)>
Get all atom factor pairs of the expression
For an expression of the form a * x + b * y + p * z + c, where x and y are atoms,
a and b are their coefficients, p is a parameter, and z is its coefficient,
this function returns the pairs (x, a), (y, b).
Sourcepub fn get_param_factor_pairs(
&self,
) -> impl Iterator<Item = (&Parameter, &Fraction)>
pub fn get_param_factor_pairs( &self, ) -> impl Iterator<Item = (&Parameter, &Fraction)>
Get all parameter factor pairs of the expression
For an expression of the form a * x + b * y + p * z + c, where x, y, z are parameters
and a, b, p are their coefficients, this function returns the pairs (p, z), where
p is the parameter and z is its coefficient.
Trait Implementations§
Source§impl<T: Clone + Display + Debug + Clone> Clone for LinearIntegerExpr<T>
impl<T: Clone + Display + Debug + Clone> Clone for LinearIntegerExpr<T>
Source§fn clone(&self) -> LinearIntegerExpr<T>
fn clone(&self) -> LinearIntegerExpr<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more