fn compute_solution_value<'a>(
        &'a self,
        variable: usize,
        new_solutions: &'a mut Vec<Option<OF>>,
    ) -> Option<&'a OF> {
        match &self.original_variables[variable].1 {
            OriginalVariable::Active(_) => None,
            OriginalVariable::ActiveFree(_, _) => None,
            OriginalVariable::Removed(Solved(value)) => Some(value),
            OriginalVariable::Removed(FunctionOfOthers { constant, coefficients }) => {
                if new_solutions[variable].is_none() {
                    new_solutions[variable] = coefficients.iter().map(|(j, coefficient)| {
                        self.compute_solution_value(*j, new_solutions).map(|v| coefficient * v)
                    })
                        .sum::<Option<OF>>()
                        .map(|inner_product| constant - inner_product);
                }

                new_solutions[variable].as_ref()
            }
        }
    }
/// Compute the solution value for a single variable.
///
/// This is a helper method of the `compute_solution_where_possible` function.
///
/// # Arguments
///
/// * `variable`: Index of the variable for which we try to determine an explicit solution.
/// * `new_solutions`: Collection containing solutions previously computed, that the computed
/// solution value will also be written in to (if it is determined).
///
/// # Return value
///
/// The solution value, if it could be determined.
Compute the solution value for a single variable.
This is a helper method of the `compute_solution_where_possible` function.
Compute the solution value for a single variable . This is a helper method of the ` compute_solution_where_possible ` function .
fn compute_solution_value<'a>(
        &'a self,
        variable: usize,
        new_solutions: &'a mut Vec<Option<OF>>,
    ) -> Option<&'a OF> {
        match &self.original_variables[variable].1 {
            OriginalVariable::Active(_) => None,
            OriginalVariable::ActiveFree(_, _) => None,
            OriginalVariable::Removed(Solved(value)) => Some(value),
            OriginalVariable::Removed(FunctionOfOthers { constant, coefficients }) => {
                if new_solutions[variable].is_none() {
                    new_solutions[variable] = coefficients.iter().map(|(j, coefficient)| {
                        self.compute_solution_value(*j, new_solutions).map(|v| coefficient * v)
                    })
                        .sum::<Option<OF>>()
                        .map(|inner_product| constant - inner_product);
                }
                new_solutions[variable].as_ref()
            }
        }
    }
fn compute_solution_value < ' a > ( & ' a self , variable : usize , new_solutions : & ' a mut Vec < Option < OF > > , ) -> Option < & ' a OF > { match & self . original_variables [ variable ] . 1 { OriginalVariable :: Active ( _ ) => None , OriginalVariable :: ActiveFree ( _ , _ ) => None , OriginalVariable :: Removed ( Solved ( value ) ) => Some ( value ) , OriginalVariable :: Removed ( FunctionOfOthers { constant , coefficients } ) => { if new_solutions [ variable ] . is_none ( ) { new_solutions [ variable ] = coefficients . iter ( ) . map ( | ( j , coefficient ) | { self . compute_solution_value ( * j , new_solutions ) . map ( | v | coefficient * v ) } ) . sum :: < Option < OF > > ( ) . map ( | inner_product | constant - inner_product ) ; } new_solutions [ variable ] . as_ref ( ) } } }
Compute the solution value for a single variable.
Compute the solution value for a single variable .
&'a self
variable
usize
new_solutions
&'a mut Vec<Option<OF>>
&'a self
variable
usize
new_solutions
&'a mut Vec<Option<OF>>
return value
The solution value, if it could be determined.
The solution value if it could be determined .