pub fn reshift_solution<G>(&self, reduced_solution: &mut SparseVector<G, G>)
    where
        G: LinearAlgebraElement<G> + SparseComparator + PartialEq<OF> + AddAssign<OF> + From<OF>,
        for<'r> &'r OF: Neg<Output=OF>,
        for<'r> &'r G: Neg<Output=G>,
    {
        debug_assert_eq!(reduced_solution.len(), self.variables.len());

        for (j, variable) in self.variables.iter().enumerate() {
            reduced_solution.shift_value::<OF>(j, -&variable.shift);
            if variable.flipped {
                if reduced_solution.get(j).is_some() {
                    let flipped = -reduced_solution.get(j).unwrap();
                    reduced_solution.set(j, flipped);
                }
            }
        }
    }
/// Transform a solution back.
///
/// When converting the problem to standard form, and during presolving, transformations to
/// variables are applied that need to be undone once a solution was computed.
///
/// # Arguments
///
/// * `reduced_solution`: Solution values for all variables that are still marked as `Active` in
/// the "original variables" of this problem.
Transform a solution back.
When converting the problem to standard form, and during presolving, transformations to
variables are applied that need to be undone once a solution was computed.
Transform a solution back . When converting the problem to standard form and during presolving transformations to variables are applied that need to be undone once a solution was computed .
pub fn reshift_solution<G>(&self, reduced_solution: &mut SparseVector<G, G>)
    where
        G: LinearAlgebraElement<G> + SparseComparator + PartialEq<OF> + AddAssign<OF> + From<OF>,
        for<'r> &'r OF: Neg<Output=OF>,
        for<'r> &'r G: Neg<Output=G>,
    {
        debug_assert_eq!(reduced_solution.len(), self.variables.len());
        for (j, variable) in self.variables.iter().enumerate() {
            reduced_solution.shift_value::<OF>(j, -&variable.shift);
            if variable.flipped {
                if reduced_solution.get(j).is_some() {
                    let flipped = -reduced_solution.get(j).unwrap();
                    reduced_solution.set(j, flipped);
                }
            }
        }
    }
pub fn reshift_solution < G > ( & self , reduced_solution : & mut SparseVector < G , G > ) where G : LinearAlgebraElement < G > + SparseComparator + PartialEq < OF > + AddAssign < OF > + From < OF > , for < ' r > & ' r OF : Neg < Output = OF > , for < ' r > & ' r G : Neg < Output = G > , { debug_assert_eq ! ( reduced_solution len ( ) self variables len ( ) ) ; for ( j , variable ) in self . variables . iter ( ) . enumerate ( ) { reduced_solution . shift_value :: < OF > ( j , - & variable . shift ) ; if variable . flipped { if reduced_solution . get ( j ) . is_some ( ) { let flipped = - reduced_solution . get ( j ) . unwrap ( ) ; reduced_solution . set ( j , flipped ) ; } } } }
Transform a solution back.
Transform a solution back .
&self
reduced_solution
&mut SparseVector<G, G>
&self
reduced_solution
&mut SparseVector<G, G>