Changeset 7 for branches


Ignore:
Timestamp:
Aug 1, 2002 11:58:30 AM (17 years ago)
Author:
forrest
Message:

For infeasible problems

Location:
branches/devel-1
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-1/ClpPrimalColumnSteepest.cpp

    r2 r7  
    891891    // initialize to 1.0
    892892    // and set reference framework
    893     if (!reference_)
    894       reference_ = new unsigned int[(numberRows+numberColumns+31)>>5];
    895     assert (sizeof(unsigned int)==4);
    896    
     893    if (!reference_) {
     894      int nWords = (number+31)>>5;
     895      reference_ = new unsigned int[nWords];
     896      assert (sizeof(unsigned int)==4);
     897      // tiny overhead to zero out (stops valgrind complaining)
     898      memset(reference_,0,nWords*sizeof(int));
     899    }
    897900   
    898901    for (iSequence=0;iSequence<number;iSequence++) {
  • branches/devel-1/ClpSimplexDual.cpp

    r2 r7  
    587587            printf("** no column pivot\n");
    588588#endif
    589           if (!factorization_->pivots()) {
     589          if (factorization_->pivots()<5) {
    590590            problemStatus_=-4; //say looks infeasible
    591591            // create ray anyway
     
    616616          }
    617617          if (iRow<numberRows_) {
    618             std::cerr<<"Flagged variables at end"<<std::endl;
    619             // what do I do now
    620             abort();
     618#ifdef CLP_DEBUG
     619            std::cerr<<"Flagged variables at end - infeasible?"<<std::endl;
     620#endif
     621            problemStatus_=-4; //say looks infeasible
     622            // create ray anyway
     623            delete [] ray_;
     624            ray_ = new double [ numberRows_];
     625            CoinDisjointCopyN(rowArray_[0]->denseVector(),numberRows_,ray_);
    621626          }
    622627        }
     
    18121817          <<OsiMessageEol;
    18131818        numberChangedBounds=changeBounds(false,NULL,changeCost);
    1814         if (numberChangedBounds<=0) {
     1819        if (numberChangedBounds<=0||dualBound_>1.0e20||
     1820            (largestPrimalError_>1.0&&dualBound_>1.0e17)) {
    18151821          problemStatus_=1; // infeasible
    18161822        } else {
    18171823          problemStatus_=-1; //iterate
    18181824          cleanDuals=true;
    1819           doOriginalTolerance=1;
     1825          doOriginalTolerance=2;
    18201826          // and delete ray which has been created
    18211827          delete [] ray_;
  • branches/devel-1/ClpSimplexPrimal.cpp

    r2 r7  
    584584          printf("** no column pivot\n");
    585585#endif
     586        if (nonLinearCost_->numberInfeasibilities())
     587          problemStatus_=-4; // might be infeasible
    586588        break;
    587589      }
     
    645647  int tentativeStatus = problemStatus_;
    646648
    647   if (problemStatus_>-3) {
     649  if (problemStatus_>-3||problemStatus_==-4) {
    648650    // factorize
    649651    // later on we will need to recover from singularities
     
    666668      changeMade_++; // say change made
    667669    }
    668     problemStatus_=-3;
     670    if (problemStatus_!=-4)
     671      problemStatus_=-3;
    669672  }
    670673  // at this stage status is -3 or -5 if looks unbounded
     
    687690  // we may wish to say it is optimal even if infeasible
    688691  bool alwaysOptimal = (specialOptions_&1)!=0;
    689   if (dualFeasible()) {
     692  if (dualFeasible()||problemStatus_==-4) {
    690693    if (nonLinearCost_->numberInfeasibilities()&&!alwaysOptimal) {
    691694      //may need infeasiblity cost changed
  • branches/devel-1/Makefile

    r2 r7  
    88# I seem to need this at present
    99OPTFLAG := -O2
    10 #OptLevel := -g
     10OptLevel := -g
     11OPTFLAG := -g
    1112ifeq ($(OptLevel),-g)
    1213    CXXFLAGS += -DCLP_DEBUG
Note: See TracChangeset for help on using the changeset viewer.