fn split_free_variables(&mut self) {
        // Select all free variables and "negative-duplicate" the column.
        let (indices_duplicated, columns) = (0..self.nr_variables())
            .filter(|&j| {
                let variable = &self.variables[j];
                variable.lower_bound.is_none() && variable.upper_bound.is_none()
            })
            .map(|j| (j, self.constraints.iter_column(j).map(|(i, v)| (*i, -v)).collect()))
            .unzip::<_, _, Vec<_>, _>();

        // Concatenate the existing constraints with the newly derived columns.
        let as_matrix = ColumnMajor::new(columns, self.nr_constraints(), indices_duplicated.len());
        self.constraints = mem::replace(
                &mut self.constraints,
                ColumnMajor::new(Vec::with_capacity(0), 0, 0),
            )
            .concatenate_horizontally(as_matrix);

        // Create the new active variables and make sure the old variable is non negative.
        for index in indices_duplicated {
            let original_index = self.from_active_to_original[index];
            self.original_variables[original_index].1 = OriginalVariable::ActiveFree(index, self.from_active_to_original.len());
            self.from_active_to_original.push(original_index);
            self.variables.push(Variable {
                variable_type: self.variables[index].variable_type,
                cost: -&self.variables[index].cost,
                lower_bound: Some(OF::zero()),
                upper_bound: None,
                shift: OF::zero(),
                flipped: false,
            });
            self.variables[index].lower_bound = Some(OF::zero());
        }
    }
/// Split all free variables.
///
/// This is done to be able to call the simplex algorithm, which can't easily handle free
/// variables directly.
///
/// See also the documentation on the `OriginalVariable::ActiveFree` variant.
Split all free variables.
This is done to be able to call the simplex algorithm, which can't easily handle free
variables directly.

See also the documentation on the `OriginalVariable::ActiveFree` variant.
Split all free variables . This is done to be able to call the simplex algorithm which can ' t easily handle free variables directly . See also the documentation on the ` OriginalVariable :: ActiveFree ` variant .
fn split_free_variables(&mut self) {
        // Select all free variables and "negative-duplicate" the column.
        let (indices_duplicated, columns) = (0..self.nr_variables())
            .filter(|&j| {
                let variable = &self.variables[j];
                variable.lower_bound.is_none() && variable.upper_bound.is_none()
            })
            .map(|j| (j, self.constraints.iter_column(j).map(|(i, v)| (*i, -v)).collect()))
            .unzip::<_, _, Vec<_>, _>();
        // Concatenate the existing constraints with the newly derived columns.
        let as_matrix = ColumnMajor::new(columns, self.nr_constraints(), indices_duplicated.len());
        self.constraints = mem::replace(
                &mut self.constraints,
                ColumnMajor::new(Vec::with_capacity(0), 0, 0),
            )
            .concatenate_horizontally(as_matrix);
        // Create the new active variables and make sure the old variable is non negative.
        for index in indices_duplicated {
            let original_index = self.from_active_to_original[index];
            self.original_variables[original_index].1 = OriginalVariable::ActiveFree(index, self.from_active_to_original.len());
            self.from_active_to_original.push(original_index);
            self.variables.push(Variable {
                variable_type: self.variables[index].variable_type,
                cost: -&self.variables[index].cost,
                lower_bound: Some(OF::zero()),
                upper_bound: None,
                shift: OF::zero(),
                flipped: false,
            });
            self.variables[index].lower_bound = Some(OF::zero());
        }
    }
fn split_free_variables ( & mut self ) { // Select all free variables and "negative-duplicate" the column. let ( indices_duplicated , columns ) = ( 0 .. self . nr_variables ( ) ) . filter ( | & j | { let variable = & self . variables [ j ] ; variable . lower_bound . is_none ( ) && variable . upper_bound . is_none ( ) } ) . map ( | j | ( j , self . constraints . iter_column ( j ) . map ( | ( i , v ) | ( * i , - v ) ) . collect ( ) ) ) . unzip :: < _ , _ , Vec < _ > , _ > ( ) ; // Concatenate the existing constraints with the newly derived columns. let as_matrix = ColumnMajor :: new ( columns , self . nr_constraints ( ) , indices_duplicated . len ( ) ) ; self . constraints = mem :: replace ( & mut self . constraints , ColumnMajor :: new ( Vec :: with_capacity ( 0 ) , 0 , 0 ) , ) . concatenate_horizontally ( as_matrix ) ; // Create the new active variables and make sure the old variable is non negative. for index in indices_duplicated { let original_index = self . from_active_to_original [ index ] ; self . original_variables [ original_index ] . 1 = OriginalVariable :: ActiveFree ( index , self . from_active_to_original . len ( ) ) ; self . from_active_to_original . push ( original_index ) ; self . variables . push ( Variable { variable_type : self . variables [ index ] . variable_type , cost : - & self . variables [ index ] . cost , lower_bound : Some ( OF :: zero ( ) ) , upper_bound : None , shift : OF :: zero ( ) , flipped : false , } ) ; self . variables [ index ] . lower_bound = Some ( OF :: zero ( ) ) ; } }
Split all free variables.
Split all free variables .
&mut self
&mut self