pub fn to_raw(&self) -> raw::Model {
        let mut start = Vec::with_capacity(self.num_cols as usize + 1);
        let mut index = Vec::with_capacity(self.num_cols.max(self.num_rows) as usize);
        let mut value = Vec::with_capacity(self.num_cols.max(self.num_rows) as usize);
        start.push(0);
        for col_weights in &self.weights {
            for (r, w) in col_weights {
                index.push(r.0 as c_int);
                value.push(*w);
            }
            start.push(index.len() as c_int);
        }
        let mut raw = raw::Model::new();
        raw.load_problem(
            self.num_cols as usize,
            self.num_rows as usize,
            &start,
            &index,
            &value,
            Some(&self.col_lower),
            Some(&self.col_upper),
            Some(&self.obj_coefficients),
            Some(&self.row_lower),
            Some(&self.row_upper),
        );
        for (col, &is_int) in self.is_integer.iter().enumerate() {
            if is_int {
                raw.set_integer(col);
            } else {
                raw.set_continuous(col);
            }
        }
        raw.set_obj_sense(self.sense);
        for (k, v) in &self.parameters {
            raw.set_parameter(k, v);
        }
        if let Some(sol) = &self.initial_solution {
            raw.set_initial_solution(sol);
        }
        self.sos1.add_to_raw(&mut raw, SOSConstraintType::Type1);
        self.sos2.add_to_raw(&mut raw, SOSConstraintType::Type2);
        raw
    }
/// Construct a `raw::Model` corresponding to the current state.
Construct a `raw::Model` corresponding to the current state.
Construct a ` raw :: Model ` corresponding to the current state .
pub fn to_raw(&self) -> raw::Model {
        let mut start = Vec::with_capacity(self.num_cols as usize + 1);
        let mut index = Vec::with_capacity(self.num_cols.max(self.num_rows) as usize);
        let mut value = Vec::with_capacity(self.num_cols.max(self.num_rows) as usize);
        start.push(0);
        for col_weights in &self.weights {
            for (r, w) in col_weights {
                index.push(r.0 as c_int);
                value.push(*w);
            }
            start.push(index.len() as c_int);
        }
        let mut raw = raw::Model::new();
        raw.load_problem(
            self.num_cols as usize,
            self.num_rows as usize,
            &start,
            &index,
            &value,
            Some(&self.col_lower),
            Some(&self.col_upper),
            Some(&self.obj_coefficients),
            Some(&self.row_lower),
            Some(&self.row_upper),
        );
        for (col, &is_int) in self.is_integer.iter().enumerate() {
            if is_int {
                raw.set_integer(col);
            } else {
                raw.set_continuous(col);
            }
        }
        raw.set_obj_sense(self.sense);
        for (k, v) in &self.parameters {
            raw.set_parameter(k, v);
        }
        if let Some(sol) = &self.initial_solution {
            raw.set_initial_solution(sol);
        }
        self.sos1.add_to_raw(&mut raw, SOSConstraintType::Type1);
        self.sos2.add_to_raw(&mut raw, SOSConstraintType::Type2);
        raw
    }
pub fn to_raw ( & self ) -> raw :: Model { let mut start = Vec :: with_capacity ( self . num_cols as usize + 1 ) ; let mut index = Vec :: with_capacity ( self . num_cols . max ( self . num_rows ) as usize ) ; let mut value = Vec :: with_capacity ( self . num_cols . max ( self . num_rows ) as usize ) ; start . push ( 0 ) ; for col_weights in & self . weights { for ( r , w ) in col_weights { index . push ( r . 0 as c_int ) ; value . push ( * w ) ; } start . push ( index . len ( ) as c_int ) ; } let mut raw = raw :: Model :: new ( ) ; raw . load_problem ( self . num_cols as usize , self . num_rows as usize , & start , & index , & value , Some ( & self . col_lower ) , Some ( & self . col_upper ) , Some ( & self . obj_coefficients ) , Some ( & self . row_lower ) , Some ( & self . row_upper ) , ) ; for ( col , & is_int ) in self . is_integer . iter ( ) . enumerate ( ) { if is_int { raw . set_integer ( col ) ; } else { raw . set_continuous ( col ) ; } } raw . set_obj_sense ( self . sense ) ; for ( k , v ) in & self . parameters { raw . set_parameter ( k , v ) ; } if let Some ( sol ) = & self . initial_solution { raw . set_initial_solution ( sol ) ; } self . sos1 . add_to_raw ( & mut raw , SOSConstraintType :: Type1 ) ; self . sos2 . add_to_raw ( & mut raw , SOSConstraintType :: Type2 ) ; raw }
Construct a `raw::Model` corresponding to the current state.
Construct a ` raw :: Model ` corresponding to the current state .
&self
&self