Ignore:
Timestamp:
Apr 27, 2007 10:54:53 AM (13 years ago)
Author:
pbelotti
Message:

diverting optimization sense as per the .nl file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/experimental/NotConvex/BonCouenneInterface.cpp

    r508 r518  
    126126     if(v.getNumElements() != length[i])
    127127       std::cout<<"Empty row"<<std::endl;
    128      cut->print();
     128     //     cut->print();
    129129     CoinCopyN(v.getIndices(), length[i], ind + start[i]);
    130130     CoinCopyN(v.getElements(), length[i], elem + start[i]);
     
    145145
    146146   // some instances have no (or null) objective function, check it here
    147    if (couenneCg.Problem () -> nObjs () > 0)
    148      obj [couenneCg.Problem () -> Obj (0) -> Body () -> Index ()] = 1;
     147   if (couenneCg. Problem () -> nObjs () > 0) {
     148
     149     // some problem may have zero or constant objective function, in
     150     // that case just put the first variable
     151
     152     int index = couenneCg. Problem () -> Obj (0) -> Body () -> Index ();
     153
     154     obj [(index >= 0) ? index : 0] =
     155       (couenneCg. Problem () -> Obj (0) -> Sense () == MINIMIZE) ? 1. : -1;
     156
     157     if (index < 0)
     158       printf ("Warning, objective function has no associated aux variable\n");
     159   }
    149160
    150161   // Finally, load interface si with the initial LP relaxation
    151162   si.loadProblem (A, colLower, colUpper, obj, rowLower, rowUpper);
    152  
     163
    153164   delete [] rowLower;
    154165   delete [] rowUpper;
Note: See TracChangeset for help on using the changeset viewer.