Changeset 578


Ignore:
Timestamp:
May 21, 2011 5:03:04 PM (9 years ago)
Author:
pbelotti
Message:

added fictitious objective when none is declared in the .nl. Fixing branch on large value with very negative lower and very large upper bounds

Location:
stable/0.3/Couenne/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable/0.3/Couenne/src/branch/CouenneObject.hpp

    r535 r578  
    166166  // Column number if single column object, -1 otherwise.
    167167  virtual int columnNumber () const
    168   {return ((reference_) ? reference_ -> Index () : -1);}
     168  {//printf ("calling columnNumber(), returning %d\n",
     169   //((reference_) ? reference_ -> Index () : -1));
     170    return ((reference_) ? reference_ -> Index () : -1);}
    169171
    170172protected:
  • stable/0.3/Couenne/src/branch/CouenneVarObject.cpp

    r569 r578  
    1515#include "CouenneBranchingObject.hpp"
    1616#include "CouenneComplObject.hpp"
     17
     18// large bounds to justify branching at zero with [-L,L] when
     19// fabs (current LP point) ~= L
     20
     21#define LARGE_VALUE 1e8
    1722
    1823/// Constructor with information for branching point selection strategy
     
    8287    // cuts, for instance.
    8388
     89    // Actually, even smaller values (such as 1e10) can trigger bad BB
     90    // tree development (see wall in test files, not globallib/wall)
     91
     92    if ((l < - LARGE_VALUE) &&
     93        (u >   LARGE_VALUE) &&
     94        (fabs (brpt) > LARGE_VALUE / 10))
     95      brpt = 0;
     96
    8497    if (l < - COUENNE_INFINITY) l = - 2 * fabs (brpt);
    8598    if (u >   COUENNE_INFINITY) u =   2 * fabs (brpt);
  • stable/0.3/Couenne/src/readnl/readnl.cpp

    r184 r578  
    195195  // objective functions /////////////////////////////////////////////////////////////
    196196
     197  if (n_obj == 0) {
     198
     199    // strange, no objective function. Add one equal to zero
     200
     201    jnlst_ -> Printf (Ipopt::J_ERROR, J_PROBLEM, "Couenne: warning, no objective function found\nAdded fictitious function f(x)=0\n");     
     202    addObjective (new exprConst (0.), "min");
     203  }
     204
    197205  for (int i = 0; i < n_obj; i++) {
    198206
Note: See TracChangeset for help on using the changeset viewer.