Changeset 748 for trunk


Ignore:
Timestamp:
Apr 7, 2006 10:41:07 AM (14 years ago)
Author:
forrest
Message:

for writeLp mainly

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpModel.cpp

    r740 r748  
    32203220                         quadratic);
    32213221  if (rowNames) {
    3222     deleteNamesAsChar(rowNames, numberRows_);
     3222    deleteNamesAsChar(rowNames, numberRows_+1);
    32233223    deleteNamesAsChar(columnNames, numberColumns_);
    32243224  }
     
    32323232  char ** rowNames = NULL;
    32333233  if (lengthNames()) {
    3234     rowNames = new char * [numberRows_];
     3234    rowNames = new char * [numberRows_+1];
    32353235    for (int iRow=0;iRow<numberRows_;iRow++) {
    32363236      rowNames[iRow] =
     
    32483248#endif
    32493249    }
     3250    rowNames[numberRows_] = strdup("OBJROW");
    32503251  }
    32513252  return reinterpret_cast<const char * const *>(rowNames);
  • trunk/ClpSimplex.cpp

    r741 r748  
    411411        save[iRow]=difference;
    412412      }
     413      int numberBasic=0;
    413414      for (iRow=0;iRow<numberRows_;iRow++) {
    414415        int iPivot=pivotVariable_[iRow];
     
    420421            sort[numberOut]=iPivot;
    421422            save[numberOut++]=difference;
     423            if (getStatus(iPivot)==basic)
     424              numberBasic++;
    422425          }
    423426        }
     427      }
     428      if (!numberBasic) {
     429        //printf("no errors on basic - going to all slack - numberOut %d\n",numberOut);
     430        allSlackBasis();
    424431      }
    425432      CoinSort_2(save, save + numberOut, sort,
  • trunk/ClpSimplexPrimal.cpp

    r747 r748  
    659659  if (numberIterations_)
    660660    lastSumInfeasibility=nonLinearCost_->sumInfeasibilities();
     661  int nPass=0;
    661662  while (numberThrownOut) {
     663    int nSlackBasic=0;
     664    if (nPass) {
     665      for (int i=0;i<numberRows_;i++) {
     666        if (getRowStatus(i)==basic)
     667          nSlackBasic++;
     668      }
     669    }
     670    nPass++;
    662671    if (problemStatus_>-3||problemStatus_==-4) {
    663672      // factorize
     
    669678        primalColumnPivot_->saveWeights(this,1);
    670679     
    671       if (type&&doFactorization) {
     680      if ((type&&doFactorization)||nSlackBasic==numberRows_) {
    672681        // is factorization okay?
    673682        int factorStatus = internalFactorize(1);
Note: See TracChangeset for help on using the changeset viewer.