pub(super) fn update_activity_variable_bound(
        &mut self,
        variable: usize,
        direction: BoundDirection,
        new: OF,
    ) -> BoundChange<OF> {
        debug_assert!(self.removed_variables.iter().all(|&(j, _)| j != variable));

        // TODO(ARCHITECTURE): Avoid these clones
        match self.activity_bounds.get(&(variable, direction)) {
            None => match self.bounds.get(&(variable, direction)) {
                None => {
                    let original = &self.general_form.variables[variable];
                    let bound = match direction {
                        BoundDirection::Lower => &original.lower_bound,
                        BoundDirection::Upper => &original.upper_bound,
                    };

                    match bound {
                        None => {
                            self.activity_bounds.insert((variable, direction), new);
                            BoundChange::NewBound
                        },
                        Some(original) => bound_compare_and_update(
                            variable, direction, new,
                            original,
                            &mut self.activity_bounds,
                        ),
                    }
                },
                Some(derived) => bound_compare_and_update(
                    variable, direction, new,
                    &derived.clone(),
                    // If the bound will already be adopted for sure, change it here
                    &mut self.bounds,
                ),
            },
            Some(activity_derived) => bound_compare_and_update(
                variable, direction, new,
                &activity_derived.clone(),
                &mut self.activity_bounds,
            ),
        }
    }
/// Update an activity variable bound.
///
/// This is the type of bound that may not be exported. That happens when the derived bound has
/// not been used to make the problem easier to solve by an algorithm.
///
/// # Arguments
///
/// * `variable`: Index of the variable to be changed.
/// * `direction`: Whether the lower or upper bound should be changed.
/// * `new`: New value for the bound.
///
/// # Return value
///
/// Type of change made: none, a shift, or added a new bound.
Update an activity variable bound.
This is the type of bound that may not be exported. That happens when the derived bound has
not been used to make the problem easier to solve by an algorithm.
Update an activity variable bound . This is the type of bound that may not be exported . That happens when the derived bound has not been used to make the problem easier to solve by an algorithm .
pub(super) fn update_activity_variable_bound(
        &mut self,
        variable: usize,
        direction: BoundDirection,
        new: OF,
    ) -> BoundChange<OF> {
        debug_assert!(self.removed_variables.iter().all(|&(j, _)| j != variable));
        // TODO(ARCHITECTURE): Avoid these clones
        match self.activity_bounds.get(&(variable, direction)) {
            None => match self.bounds.get(&(variable, direction)) {
                None => {
                    let original = &self.general_form.variables[variable];
                    let bound = match direction {
                        BoundDirection::Lower => &original.lower_bound,
                        BoundDirection::Upper => &original.upper_bound,
                    };
                    match bound {
                        None => {
                            self.activity_bounds.insert((variable, direction), new);
                            BoundChange::NewBound
                        },
                        Some(original) => bound_compare_and_update(
                            variable, direction, new,
                            original,
                            &mut self.activity_bounds,
                        ),
                    }
                },
                Some(derived) => bound_compare_and_update(
                    variable, direction, new,
                    &derived.clone(),
                    // If the bound will already be adopted for sure, change it here
                    &mut self.bounds,
                ),
            },
            Some(activity_derived) => bound_compare_and_update(
                variable, direction, new,
                &activity_derived.clone(),
                &mut self.activity_bounds,
            ),
        }
    }
pub ( super ) fn update_activity_variable_bound ( & mut self , variable : usize , direction : BoundDirection , new : OF , ) -> BoundChange < OF > { debug_assert ! ( self removed_variables iter ( ) all ( ( j ) j variable ) ) ; // TODO(ARCHITECTURE): Avoid these clones match self . activity_bounds . get ( & ( variable , direction ) ) { None => match self . bounds . get ( & ( variable , direction ) ) { None => { let original = & self . general_form . variables [ variable ] ; let bound = match direction { BoundDirection :: Lower => & original . lower_bound , BoundDirection :: Upper => & original . upper_bound , } ; match bound { None => { self . activity_bounds . insert ( ( variable , direction ) , new ) ; BoundChange :: NewBound } , Some ( original ) => bound_compare_and_update ( variable , direction , new , original , & mut self . activity_bounds , ) , } } , Some ( derived ) => bound_compare_and_update ( variable , direction , new , & derived . clone ( ) , // If the bound will already be adopted for sure, change it here & mut self . bounds , ) , } , Some ( activity_derived ) => bound_compare_and_update ( variable , direction , new , & activity_derived . clone ( ) , & mut self . activity_bounds , ) , } }
Update an activity variable bound.
Update an activity variable bound .
&mut self
variable
usize
direction
BoundDirection
new
OF
&mut self
variable
usize
direction
BoundDirection
new
OF
return value
Type of change made: none, a shift, or added a new bound.
Type of change made : none a shift or added a new bound .