Ignore:
Timestamp:
Mar 7, 2014 12:00:35 PM (6 years ago)
Author:
forrest
Message:

mods for mipstart

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcMipStartIO.cpp

    r1957 r2013  
    8282      model->messageHandler()->message(CBC_GENERAL, model->messages())
    8383        << printLine << CoinMessageEol;
     84      if (colValues.size()<model->getNumCols()) {
     85        int numberColumns = model->getNumCols();
     86        OsiSolverInterface * solver = model->solver();
     87        vector< pair< string, double > > fullValues;
     88        /* for fast search of column names */
     89        map< string, int > colIdx;
     90        for (int i=0;i<numberColumns;i++) {
     91          fullValues.push_back( pair<string, double>(solver->getColName(i),0.0) );
     92          colIdx[solver->getColName(i)] = i;
     93        }
     94        for ( int i=0 ; (i<(int)colValues.size()) ; ++i )
     95          {
     96            map< string, int >::const_iterator mIt = colIdx.find( colValues[i].first );
     97            if ( mIt != colIdx.end() ) {
     98              const int idx = mIt->second;
     99              double v = colValues[i].second;
     100              fullValues[idx].second=v;
     101            }
     102          }
     103        colValues=fullValues;
     104      }
    84105   } else
    85106   {
     
    105126   map< string, int > colIdx;
    106127   assert( ((int)colNames.size()) == lp->getNumCols() );
    107 
    108128   /* for fast search of column names */
    109129   for ( int i=0 ; (i<(int)colNames.size()) ; ++i )
     
    170190   lp->setHintParam(OsiDoPresolveInInitial, true, OsiHintDo) ;
    171191#endif
     192   lp->setDblParam(OsiDualObjectiveLimit,COIN_DBL_MAX);
    172193   lp->initialSolve();
    173194   //lp->writeMps("fixed","mps");
Note: See TracChangeset for help on using the changeset viewer.