Changeset 460


Ignore:
Timestamp:
Sep 30, 2004 2:28:48 PM (15 years ago)
Author:
forrest
Message:

a bit faster plus compiler bug in ClpsimplexPrimal?

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpSimplex.cpp

    r451 r460  
    376376  CoinIndexedVector  * workSpace = rowArray_[0];
    377377
    378   CoinIndexedVector arrayVector;
    379   arrayVector.reserve(numberRows_+1);
    380   CoinIndexedVector previousVector;
    381   previousVector.reserve(numberRows_+1);
    382 
     378  CoinIndexedVector * arrayVector = rowArray_[1];
     379  arrayVector->clear();
     380  CoinIndexedVector * previousVector = rowArray_[2];
     381  previousVector->clear();
    383382  // accumulate non basic stuff
    384383
     
    389388  if (rowActivities!=rowActivityWork_)
    390389    ClpDisjointCopyN(rowActivities,numberRows_,rowActivityWork_);
    391   double * array = arrayVector.denseVector();
    392   int * index = arrayVector.getIndices();
     390  double * array = arrayVector->denseVector();
     391  int * index = arrayVector->getIndices();
    393392  int number=0;
    394393  const double * rhsOffset = matrix_->rhsOffset(this,false,true);
     
    429428    }
    430429  }
    431   arrayVector.setNumElements(number);
     430  arrayVector->setNumElements(number);
    432431#ifdef CLP_DEBUG
    433432  if (numberIterations_==-3840) {
     
    450449  int iRefine;
    451450  double * work = workSpace->denseVector();
    452   CoinIndexedVector * thisVector = &arrayVector;
    453   CoinIndexedVector * lastVector = &previousVector;
     451  CoinIndexedVector * thisVector = arrayVector;
     452  CoinIndexedVector * lastVector = previousVector;
    454453  factorization_->updateColumn(workSpace,thisVector);
    455454#ifdef CLP_DEBUG
     
    556555    }
    557556  }
     557  arrayVector->clear();
     558  previousVector->clear();
    558559#ifdef CLP_DEBUG
    559560  if (numberIterations_==-3840) {
     
    571572    CoinIndexedVector  * workSpace = rowArray_[0];
    572573   
    573     CoinIndexedVector arrayVector;
    574     arrayVector.reserve(numberRows_+1);
    575     CoinIndexedVector previousVector;
    576     previousVector.reserve(numberRows_+1);
    577    
     574    CoinIndexedVector * arrayVector = rowArray_[1];
     575    arrayVector->clear();
     576    CoinIndexedVector * previousVector = rowArray_[2];
     577    previousVector->clear();
    578578   
    579579    int iRow;
     
    581581    workSpace->checkClear();
    582582#endif
    583     double * array = arrayVector.denseVector();
    584     int * index = arrayVector.getIndices();
     583    double * array = arrayVector->denseVector();
     584    int * index = arrayVector->getIndices();
    585585    int number=0;
    586586    if (!givenDjs) {
     
    607607      }
    608608    }
    609     arrayVector.setNumElements(number);
     609    arrayVector->setNumElements(number);
    610610    // Extended duals before "updateTranspose"
    611     matrix_->dualExpanded(this,&arrayVector,givenDjs,0);
     611    matrix_->dualExpanded(this,arrayVector,givenDjs,0);
    612612   
    613613    // Btran basic costs and get as accurate as possible
     
    615615    int iRefine;
    616616    double * work = workSpace->denseVector();
    617     CoinIndexedVector * thisVector = &arrayVector;
    618     CoinIndexedVector * lastVector = &previousVector;
     617    CoinIndexedVector * thisVector = arrayVector;
     618    CoinIndexedVector * lastVector = previousVector;
    619619    factorization_->updateColumnTranspose(workSpace,thisVector);
    620620   
     
    800800      memcpy(givenDjs,dj_,(numberRows_+numberColumns_)*sizeof(double));
    801801    }
     802    arrayVector->clear();
     803    previousVector->clear();
    802804  } else {
    803805    // Nonlinear
  • trunk/ClpSimplexDual.cpp

    r457 r460  
    458458
    459459  // Get dubious weights
     460  CoinBigIndex * dubiousWeights = NULL;
     461#ifdef DUBIOUS_WEIGHTS
    460462  factorization_->getWeights(rowArray_[0]->getIndices());
    461   CoinBigIndex * dubiousWeights = matrix_->dubiousWeights(this,rowArray_[0]->getIndices());
     463  dubiousWeights = matrix_->dubiousWeights(this,rowArray_[0]->getIndices());
     464#endif
    462465  // If values pass then get list of candidates
    463466  int * candidateList = NULL;
     
    708711        // do ratio test
    709712        checkPossibleValuesMove(rowArray_[0],columnArray_[0],
    710                                             acceptablePivot,NULL);
     713                                            acceptablePivot);
    711714
    712715        // recompute true dualOut_
     
    41224125ClpSimplexDual::checkPossibleValuesMove(CoinIndexedVector * rowArray,
    41234126                                        CoinIndexedVector * columnArray,
    4124                                         double acceptablePivot,
    4125                                         CoinBigIndex * dubiousWeights)
     4127                                        double acceptablePivot)
    41264128{
    41274129  double * work;
  • trunk/ClpSimplexPrimal.cpp

    r438 r460  
    11611161
    11621162  int iIndex;
    1163   bool gotList=false;
    11641163  int pivotOne=-1;
    11651164  //#define CLP_DEBUG
     
    11801179  }
    11811180#endif
    1182   while (!gotList) {
     1181  while (true) {
    11831182    pivotOne=-1;
    11841183    totalThru=0.0;
     
    12301229    if (upperTheta<maximumMovement&&totalThru*infeasibilityCost_>=1.0001*dualCheck) {
    12311230      // Can pivot here
    1232       gotList=true;
     1231      break;
    12331232    } else if (tentativeTheta<maximumMovement) {
    12341233      //printf("Going round with average theta of %g\n",averageTheta);
    12351234      tentativeTheta=maximumMovement;
    12361235    } else {
    1237       gotList=true;
     1236      break;
    12381237    }
    12391238  }
  • trunk/ClpSolve.cpp

    r451 r460  
    720720    int numberArtificials=0;
    721721    double * addCost = new double [numberRows];
    722     const double penalty=1.0e8;
     722    const double penalty=1.0e8*optimizationDirection_;
    723723    int iRow;
    724724    for (iRow=0;iRow<numberRows;iRow++) {
     
    819819    int smallNumberColumns = CoinMin(3*numberRows,numberColumns);
    820820    smallNumberColumns = CoinMax(smallNumberColumns,3000);
     821    smallNumberColumns = CoinMin(smallNumberColumns,numberColumns);
    821822    //int smallNumberColumns = CoinMin(12*numberRows/10,numberColumns);
    822823    //smallNumberColumns = CoinMax(smallNumberColumns,3000);
  • trunk/include/ClpSimplexDual.hpp

    r451 r460  
    199199  int checkPossibleValuesMove(CoinIndexedVector * rowArray,
    200200                               CoinIndexedVector * columnArray,
    201                               double acceptablePivot,
    202                               CoinBigIndex * dubiousWeights);
     201                              double acceptablePivot);
    203202  /**
    204203      This sees if we can move duals in dual values pass.
Note: See TracChangeset for help on using the changeset viewer.