fn column_type(&self, j: usize) -> ColumnType {
        debug_assert!(j < self.nr_columns());

        let separating_indices = self.get_variable_separating_indices();
        debug_assert!(separating_indices.is_sorted());

        // TODO(OPTIMIZATION): Binary search might be faster, but it would need to select the
        //  left-most element of equal elements in the cumulative group indices.
        let mut group_number = 0;
        while group_number + 1 < NR_VARIABLE_TYPES && j >= separating_indices[group_number + 1] {
            group_number += 1;
        }

        let index_in_group = j - separating_indices[group_number];
        match group_number {
            0 => ColumnType::Normal(index_in_group),
            1 => ColumnType::RangeSlack(index_in_group),
            2 => ColumnType::UpperInequalitySlack(index_in_group),
            3 => ColumnType::LowerInequalitySlack(index_in_group),
            4 => ColumnType::VariableBoundSlack(index_in_group),
            5 => ColumnType::SlackBoundSlack(index_in_group),
            _ => unreachable!("Should have `self.nr_columns() == separating_indices[5]`"),
        }
    }
/// Classify a column by type using the column index.
///
/// See the struct documentation for a visualization.
Classify a column by type using the column index.
See the struct documentation for a visualization.
Classify a column by type using the column index . See the struct documentation for a visualization .
fn column_type(&self, j: usize) -> ColumnType {
        debug_assert!(j < self.nr_columns());
        let separating_indices = self.get_variable_separating_indices();
        debug_assert!(separating_indices.is_sorted());
        // TODO(OPTIMIZATION): Binary search might be faster, but it would need to select the
        //  left-most element of equal elements in the cumulative group indices.
        let mut group_number = 0;
        while group_number + 1 < NR_VARIABLE_TYPES && j >= separating_indices[group_number + 1] {
            group_number += 1;
        }
        let index_in_group = j - separating_indices[group_number];
        match group_number {
            0 => ColumnType::Normal(index_in_group),
            1 => ColumnType::RangeSlack(index_in_group),
            2 => ColumnType::UpperInequalitySlack(index_in_group),
            3 => ColumnType::LowerInequalitySlack(index_in_group),
            4 => ColumnType::VariableBoundSlack(index_in_group),
            5 => ColumnType::SlackBoundSlack(index_in_group),
            _ => unreachable!("Should have `self.nr_columns() == separating_indices[5]`"),
        }
    }
fn column_type ( & self , j : usize ) -> ColumnType { debug_assert ! ( j self nr_columns ( ) ) ; let separating_indices = self . get_variable_separating_indices ( ) ; debug_assert ! ( separating_indices is_sorted ( ) ) ; // TODO(OPTIMIZATION): Binary search might be faster, but it would need to select the //  left-most element of equal elements in the cumulative group indices. let mut group_number = 0 ; while group_number + 1 < NR_VARIABLE_TYPES && j >= separating_indices [ group_number + 1 ] { group_number += 1 ; } let index_in_group = j - separating_indices [ group_number ] ; match group_number { 0 => ColumnType :: Normal ( index_in_group ) , 1 => ColumnType :: RangeSlack ( index_in_group ) , 2 => ColumnType :: UpperInequalitySlack ( index_in_group ) , 3 => ColumnType :: LowerInequalitySlack ( index_in_group ) , 4 => ColumnType :: VariableBoundSlack ( index_in_group ) , 5 => ColumnType :: SlackBoundSlack ( index_in_group ) , _ => unreachable ! ( " " ) , } }
Classify a column by type using the column index.
Classify a column by type using the column index .
&self
j
usize
&self
j
usize