Changeset 316


Ignore:
Timestamp:
Mar 14, 2010 12:33:56 PM (10 years ago)
Author:
pbelotti
Message:

Check initial solution for MINLP feasibility, and possibly set cutoff (thanks to Bruno Conti Marini for the suggestion). Restore initial nlp. Minor fixes

Location:
trunk/Couenne/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/interfaces/BonCouenneInterface.cpp

    r311 r316  
    6868  bool is_feasible = true;
    6969
    70   if (false && solveNlp) {
     70  if (solveNlp) {
    7171
    7272    int nvars = p -> nVars();
  • trunk/Couenne/src/problem/problem.cpp

    r315 r316  
    303303void CouenneProblem::installCutOff () const {
    304304
    305   int indobj = objectives_ [0] -> Body () -> Index ();
    306 
    307   assert (indobj >= 0);
    308 
    309305  // all problem are assumed to be minimization
    310306  double cutoff = pcutoff_ -> getCutOff();
    311307
    312   Jnlst () -> Printf (Ipopt::J_WARNING, J_PROBLEM,
    313                       "installing cutoff %.10e vs current ub %.10e\n",
    314                       cutoff, Ub (indobj));
     308  if (cutoff > COUENNE_INFINITY)
     309    return;
     310
     311  int indobj = objectives_ [0] -> Body () -> Index ();
     312
     313  assert (indobj >= 0);
     314
     315  //Jnlst () -> Printf (Ipopt::J_WARNING, J_PROBLEM,
     316  //"installing cutoff %.10e vs current ub %.10e\n",
     317  //cutoff, Ub (indobj));
    315318
    316319  if (cutoff < Ub (indobj))
  • trunk/Couenne/src/problem/reformulate.cpp

    r312 r316  
    7979  initAuxs ();
    8080
     81  CouNumber cutoff;
     82  // check for initial solution given to Couenne. If feasible, set cutoff
     83  if (checkNLP (X (), cutoff = X (objectives_ [0] -> Body () -> Index ()), true)) {
     84    jnlst_ -> Printf (Ipopt::J_ERROR, J_PROBLEM,
     85                      "Couenne: initial solution (value %g) is MINLP feasible\n",
     86                      cutoff);
     87    setCutOff (cutoff);   
     88  }
     89
    8190  // fill dependence_ structure
    8291  fillDependence (bonBase_, cg);
Note: See TracChangeset for help on using the changeset viewer.