示例#1
0
void SCIPSolver::initialise(){
  DBG("initialise the solver%s\n", "");
  MipWrapperSolver::initialise();
  if(_obj != NULL) add_in_constraint(_obj, _obj_coef);
  for(unsigned int i = 0; i < _constraints.size(); ++i)
    add_in_constraint(_constraints[i]);
  has_been_added = true;
}
示例#2
0
void CPLEXSolver::initialise() {
    DBG("Initialising solver with no expressions%s\n", "");
    MipWrapperSolver::initialise();

    if(_obj != NULL){
        add_in_constraint(_obj, _obj_coef);
    }

    for(unsigned int i = 0; i < _constraints.size(); ++i)
        add_in_constraint(_constraints[i]);
    has_been_added = true;
}
示例#3
0
void GurobiSolver::initialise(){
    DBG("initialise the solver %s\n", "");
    MipWrapperSolver::initialise();

    // Add all variables
    if (_obj != NULL){
        add_variables_from(_obj, _obj_coef);
    }
    for(unsigned int i = 0; i < _constraints.size(); ++i)
        add_variables_from(_constraints[i]);

    // Update model so we can use variables in constraints
    model->update();

    // Add constraints
    if(_obj != NULL){
        add_in_constraint(_obj, _obj_coef);
    }

    for(unsigned int i = 0; i < _constraints.size(); ++i)
        add_in_constraint(_constraints[i]);
    has_been_added = true;
}