Ignore:
Timestamp:
Jul 18, 2008 11:25:46 AM (11 years ago)
Author:
forrest
Message:

change behavior with zero objective

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpSimplexDual.cpp

    r1201 r1243  
    227227  // If user asked for perturbation - do it
    228228  if (!startup(0,startFinishOptions)) {
     229    int usePrimal=0;
    229230    // looks okay
    230231    // Superbasic variables not allowed
     
    232233    if (ifValuesPass) {
    233234      if (problemStatus_&&perturbation_<100)
    234         perturb();
     235        usePrimal=perturb();
    235236      int i;
    236237      if (scalingFlag_>0) {
     
    304305      bool inCbcOrOther = (specialOptions_&0x03000000)!=0;
    305306      if (!inCbcOrOther)
    306         perturb();
     307        usePrimal=perturb();
    307308      // Can't get here if values pass
    308309      gutsOfSolution(NULL,NULL);
     
    321322      if (inCbcOrOther) {
    322323        if (numberPrimalInfeasibilities_) {
    323           perturb();
     324          usePrimal=perturb();
    324325          if (perturbation_>=101)
    325326            computeDuals(NULL);
     
    337338      gutsOfSolution(NULL,NULL);
    338339    }
    339     return 0;
     340    if (usePrimal) {
     341      problemStatus_=10;
     342#if COIN_DEVELOP>1
     343      printf("returning to use primal (no obj) at %d\n",__LINE__);
     344#endif
     345    }
     346    return usePrimal;
    340347  } else {
    341348    return 1;
     
    45184525}
    45194526// Perturbs problem
    4520 void
     4527int
    45214528ClpSimplexDual::perturb()
    45224529{
    45234530  if (perturbation_>100)
    4524     return; //perturbed already
     4531    return 0; //perturbed already
    45254532  if (perturbation_==100)
    45264533    perturbation_=50; // treat as normal
     
    45744581    }
    45754582    delete [] sort;
     4583    if (!numberNonZero)
     4584      return 1; // safer to use primal
    45764585#if 0
    45774586    printf("nnz %d percent %d",number,(number*100)/numberColumns_);
     
    45884597    if (number*4>numberColumns_) {
    45894598      perturbation_=100;
    4590       return; // good enough
     4599      return 0; // good enough
    45914600    }
    45924601  }
     
    48614870  // say perturbed
    48624871  perturbation_=101;
    4863 
     4872  return 0;
    48644873}
    48654874/* For strong branching.  On input lower and upper are new bounds
Note: See TracChangeset for help on using the changeset viewer.