Changeset 1899


Ignore:
Timestamp:
Apr 6, 2013 4:43:00 PM (9 years ago)
Author:
stefan
Message:

sync with trunk rev 1898

Location:
stable/0.106/Osi
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • stable/0.106/Osi

  • stable/0.106/Osi/src/Osi/OsiBranchingObject.cpp

    r1881 r1899  
    15011501    bound_[0]=points[sort[0]*2];
    15021502    bound_[1]=points[sort[0]*2+1];
    1503     double lo=bound_[0];
    15041503    double hi=bound_[1];
    1505     assert (hi>=lo);
     1504    assert (hi>=bound_[0]);
    15061505    for (i=1;i<numberPoints;i++) {
    15071506      double thisLo =points[sort[i]*2];
     
    15121511        bound_[2*numberRanges_+1]=thisHi;
    15131512        numberRanges_++;
    1514         lo=thisLo;
    15151513        hi=thisHi;
    15161514      } else {
  • stable/0.106/Osi/src/Osi/OsiPresolve.cpp

    r1833 r1899  
    498498      dynamic_cast<CoinWarmStartBasis *>(presolvedModel_->getEmptyWarmStart()) ;
    499499    basis->setSize(ncols0,nrows0) ;
    500     double infty = originalModel_->getInfinity() ;
    501500    for (int i = 0 ; i < ncols0 ; i++) {
    502501      CoinWarmStartBasis::Status status =
    503502          static_cast<CoinWarmStartBasis::Status>(prob.getColumnStatus(i)) ;
    504       assert(status != CoinWarmStartBasis::atLowerBound ||
    505              originalModel_->getColLower()[i] > -infty) ;
    506       assert(status != CoinWarmStartBasis::atUpperBound ||
    507              originalModel_->getColUpper()[i] <  infty) ;
     503      assert(status != CoinWarmStartBasis::atLowerBound || originalModel_->getColLower()[i] > -originalModel_->getInfinity()) ;
     504      assert(status != CoinWarmStartBasis::atUpperBound || originalModel_->getColUpper()[i] <  originalModel_->getInfinity()) ;
    508505      basis->setStructStatus(i,status);
    509506    }
  • stable/0.106/Osi/src/Osi/OsiRowCutDebugger.cpp

    r1690 r1899  
    266266  // only consider characters between '/' and '.'
    267267  std::string modelL; //name in lowercase
    268   int iput=0;
    269268  for (i=0;i<static_cast<int> (strlen(model));i++) {
    270269    char value=static_cast<char>(tolower(model[i]));
    271270    if (value=='/') {
    272       iput=0;
    273271      modelL.erase();
    274272    } else if (value=='.') {
  • stable/0.106/Osi/src/OsiCommonTest/OsiSolverInterfaceTest.cpp

    r1835 r1899  
    13891389
    13901390void testNames (const OsiSolverInterface *emptySi, std::string fn)
    1391 { int nameDiscipline ;
     1391{
    13921392  bool recognisesOsiNames = true ;
    13931393  bool ok ;
     
    17161716*/
    17171717  // std::cout << "Switching to full names." << std::endl ;
    1718   nameDiscipline = 2 ;
    17191718  OSIUNITTEST_ASSERT_WARNING(si->setIntParam(OsiNameDiscipline,2), delete si; return, solverName, "testNames lazy names: change name discipline");
    17201719  m = si->getNumRows() ;
     
    34323431
    34333432  std::vector<double *> rays ;
    3434   bool catchSomeRays ;
    34353433  const int raysRequested = 5 ;
    34363434  const std::string mpsNames[] = { "galenet", "galenetbnds" } ;
     
    34553453      << ((fullRay == true)?",true":"") << ") ... " ;
    34563454
    3457     int nameDiscipline = 1 ;
    3458     si->setIntParam(OsiNameDiscipline,nameDiscipline) ;
     3455    si->setIntParam(OsiNameDiscipline,1) ;
    34593456
    34603457    OSIUNITTEST_ASSERT_ERROR(si->readMps(fn.c_str(),"mps") == 0, delete si; return, solverName, "testDualRays: read MPS");
     
    34733470  try again.
    34743471*/
    3475     catchSomeRays = false ;
    34763472    try
    34773473    { rays = si->getDualRays(raysRequested,fullRay) ;
    3478       catchSomeRays = true ;
    34793474      hasGetDualRays = true ;
    34803475      std::cout << "yes." << std::endl ; }
  • stable/0.106/Osi/src/OsiCpx

  • stable/0.106/Osi/src/OsiCpx/OsiCpxSolverInterface.cpp

    r1875 r1899  
    255255  switchToLP();
    256256
     257  bool takeHint;
     258  OsiHintStrength strength;
     259 
    257260  int algorithm = 0;
    258   bool takeHint, gotHint;
    259   OsiHintStrength strength;
    260   gotHint = (getHintParam(OsiDoDualInInitial,takeHint,strength));
    261   assert (gotHint);
     261  getHintParam(OsiDoDualInInitial,takeHint,strength);
    262262  if (strength!=OsiHintIgnore)
    263263     algorithm = takeHint ? -1 : 1;
    264264
    265265  int presolve = 1;
    266   gotHint = (getHintParam(OsiDoPresolveInInitial,takeHint,strength));
    267   assert (gotHint);
     266  getHintParam(OsiDoPresolveInInitial,takeHint,strength);
    268267  if (strength!=OsiHintIgnore)
    269268     presolve = takeHint ? 1 : 0;
     
    386385  switchToLP();
    387386
     387  bool takeHint;
     388  OsiHintStrength strength;
     389
    388390  int algorithm = 0;
    389   bool takeHint, gotHint;
    390   OsiHintStrength strength;
    391   gotHint = (getHintParam(OsiDoDualInResolve,takeHint,strength));
    392   assert (gotHint);
     391  getHintParam(OsiDoDualInResolve,takeHint,strength);
    393392  if (strength!=OsiHintIgnore)
    394393     algorithm = takeHint ? -1 : 1;
    395394
    396395  int presolve = 0;
    397   gotHint = (getHintParam(OsiDoPresolveInResolve,takeHint,strength));
    398   assert (gotHint);
     396  getHintParam(OsiDoPresolveInResolve,takeHint,strength);
    399397  if (strength!=OsiHintIgnore)
    400398     presolve = takeHint ? 1 : 0;
     
    13141312     
    13151313      int requiredSpace;
    1316       int rc = CPXgetrows( env_, getMutableLpPtr(),
     1314      CPXgetrows( env_, getMutableLpPtr(),
    13171315                           &nelems, starts, NULL, NULL, 0, &requiredSpace,
    13181316                           0, nrows-1 );
     
    13221320      double  *elements = new double[-requiredSpace];
    13231321     
    1324       rc = CPXgetrows( env_, getMutableLpPtr(),
     1322      CPXgetrows( env_, getMutableLpPtr(),
    13251323                       &nelems, starts, indices, elements, -requiredSpace,
    13261324                       &requiredSpace, 0, nrows-1 );
     
    13601358     
    13611359      int requiredSpace;
    1362       int rc = CPXgetcols( env_, getMutableLpPtr(),
     1360      CPXgetcols( env_, getMutableLpPtr(),
    13631361                           &nelems, starts, NULL, NULL, 0, &requiredSpace,
    13641362                           0, ncols-1 );
     
    13681366      double  *elements = new double[-requiredSpace];
    13691367     
    1370       rc = CPXgetcols( env_, getMutableLpPtr(),
     1368      CPXgetcols( env_, getMutableLpPtr(),
    13711369                       &nelems, starts, indices, elements, -requiredSpace,
    13721370                       &requiredSpace, 0, ncols-1 );
  • stable/0.106/Osi/src/OsiGlpk

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.106/Osi/src/OsiGrb

  • stable/0.106/Osi/src/OsiGrb/OsiGrbSolverInterface.cpp

    r1845 r1899  
    259259{
    260260  debugMessage("OsiGrbSolverInterface::initialSolve()\n");
    261   bool takeHint, gotHint;
     261  bool takeHint;
    262262  OsiHintStrength strength;
    263263  int prevalgorithm = -1;
     
    268268
    269269  /* set whether dual or primal, if hint has been given */
    270   gotHint = getHintParam(OsiDoDualInInitial,takeHint,strength);
    271   assert(gotHint);
     270  getHintParam(OsiDoDualInInitial,takeHint,strength);
    272271  if (strength != OsiHintIgnore) {
    273272        GUROBI_CALL( "initialSolve", GRBgetintparam(GRBgetenv(lp), GRB_INT_PAR_METHOD, &prevalgorithm) );
     
    277276        /* set whether presolve or not */
    278277  int presolve = GRB_PRESOLVE_AUTO;
    279   gotHint = getHintParam(OsiDoPresolveInInitial,takeHint,strength);
    280   assert (gotHint);
     278  getHintParam(OsiDoPresolveInInitial,takeHint,strength);
    281279  if (strength != OsiHintIgnore)
    282280        presolve = takeHint ? GRB_PRESOLVE_AUTO : GRB_PRESOLVE_OFF;
     
    309307{
    310308  debugMessage("OsiGrbSolverInterface::resolve()\n");
    311   bool takeHint, gotHint;
     309  bool takeHint;
    312310  OsiHintStrength strength;
    313311  int prevalgorithm = -1;
     
    318316
    319317  /* set whether primal or dual */
    320   gotHint = getHintParam(OsiDoDualInResolve,takeHint,strength);
    321   assert (gotHint);
     318  getHintParam(OsiDoDualInResolve,takeHint,strength);
    322319  if (strength != OsiHintIgnore) {
    323320        GUROBI_CALL( "resolve", GRBgetintparam(GRBgetenv(lp), GRB_INT_PAR_METHOD, &prevalgorithm) );
     
    327324        /* set whether presolve or not */
    328325  int presolve = GRB_PRESOLVE_OFF;
    329   gotHint = getHintParam(OsiDoPresolveInResolve,takeHint,strength);
    330   assert (gotHint);
     326  getHintParam(OsiDoPresolveInResolve,takeHint,strength);
    331327  if (strength != OsiHintIgnore)
    332328        presolve = takeHint ? GRB_PRESOLVE_AUTO : GRB_PRESOLVE_OFF;
  • stable/0.106/Osi/src/OsiMsk

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.106/Osi/src/OsiSpx/OsiSpxSolverInterface.cpp

    r1863 r1899  
    7474void OsiSpxSolverInterface::initialSolve()
    7575{
     76  bool takeHint;
     77  OsiHintStrength strength;
     78
    7679  // by default we use dual simplex
     80  // unless we get the hint to use primal simplex
    7781  bool dual = true;
    78 
    79   // unless we get the hint to use primal simplex
    80   bool takeHint, gotHint;
    81   OsiHintStrength strength;
    82   gotHint = (getHintParam(OsiDoDualInInitial,takeHint,strength));
    83   assert (gotHint);
     82  getHintParam(OsiDoDualInInitial,takeHint,strength);
    8483  if (strength!=OsiHintIgnore)
    8584     dual = takeHint;
     
    139138void OsiSpxSolverInterface::resolve()
    140139{
     140  bool takeHint;
     141  OsiHintStrength strength;
     142 
    141143  // by default we use dual simplex
     144  // unless we get the hint to use primal simplex
    142145  bool dual = true;
    143 
    144   // unless we get the hint to use primal simplex
    145   bool takeHint, gotHint;
    146   OsiHintStrength strength;
    147   gotHint = (getHintParam(OsiDoDualInResolve,takeHint,strength));
    148   assert (gotHint);
     146  getHintParam(OsiDoDualInResolve,takeHint,strength);
    149147  if (strength!=OsiHintIgnore)
    150148     dual = takeHint;
     
    358356OsiSpxSolverInterface::getStrParam(OsiStrParam key, std::string & value) const
    359357{
    360   bool retval = false;
    361358  switch (key) {
    362359  case OsiSolverName:
    363360    value = "SoPlex";
    364     break;
    365   case OsiLastStrParam:
    366   case OsiProbName:
    367     retval = false;
    368     break;
    369   }
    370   return true;
     361    return true;
     362  default: ;
     363  }
     364  return false;
    371365}
    372366
Note: See TracChangeset for help on using the changeset viewer.