Changeset 262


Ignore:
Timestamp:
Nov 25, 2003 12:14:21 PM (16 years ago)
Author:
forrest
Message:

minor presolve

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpPresolve.cpp

    r259 r262  
    359359const CoinPresolveAction *ClpPresolve::presolve(CoinPresolveMatrix *prob)
    360360{
     361  // Messages
     362  CoinMessages messages = CoinMessage(prob->messages().language());
    361363  paction_ = 0;
    362364
     
    624626          if (!hinrow[i])
    625627            numberDropped++;
     628       
     629        prob->messageHandler()->message(COIN_PRESOLVE_PASS,
     630                                        messages)
     631                                          <<numberDropped<<iLoop+1
     632                                          <<CoinMessageEol;
    626633        //printf("%d rows dropped after pass %d\n",numberDropped,
    627634        //     iLoop+1);
     
    649656  }
    650657 
    651   // Messages
    652   CoinMessages messages = CoinMessage(prob->messages().language());
    653658  if (prob->status_) {
    654659    if (prob->status_==1)
  • trunk/ClpSimplexDual.cpp

    r260 r262  
    33673367      status=problemStatus_;
    33683368    }
     3369    if (status||(problemStatus_==0&&!isDualObjectiveLimitReached())) {
     3370      objectiveChange = objectiveValue_-saveObjectiveValue;
     3371    } else {
     3372      objectiveChange = 1.0e100;
     3373      status=1;
     3374    }
    33693375
    33703376    if (scalingFlag_<=0) {
     
    33943400    factorization_ = new ClpFactorization(saveFactorization);
    33953401
    3396     if (status||(problemStatus_==0&&!isDualObjectiveLimitReached())) {
    3397       objectiveChange = objectiveValue_-saveObjectiveValue;
    3398     } else {
    3399       objectiveChange = 1.0e100;
    3400     }
    34013402    newUpper[i]=objectiveChange;
    34023403#ifdef CLP_DEBUG
     
    34263427      status=problemStatus_;
    34273428    }
     3429    if (status||(problemStatus_==0&&!isDualObjectiveLimitReached())) {
     3430      objectiveChange = objectiveValue_-saveObjectiveValue;
     3431    } else {
     3432      objectiveChange = 1.0e100;
     3433      status=1;
     3434    }
    34283435    if (scalingFlag_<=0) {
    34293436      memcpy(outputSolution[iSolution],solution_,numberColumns_*sizeof(double));
     
    34533460    factorization_ = new ClpFactorization(saveFactorization);
    34543461
    3455     if (status||(problemStatus_==0&&!isDualObjectiveLimitReached())) {
    3456       objectiveChange = objectiveValue_-saveObjectiveValue;
    3457     } else {
    3458       objectiveChange = 1.0e100;
    3459     }
    34603462    newLower[i]=objectiveChange;
    34613463#ifdef CLP_DEBUG
  • trunk/include/ClpHelperFunctions.hpp

    r225 r262  
    11
    2 inline double pdxxxmerit(int nlow, int nupp, int *low, int *upp, CoinDenseVector &r1,
    3                 CoinDenseVector &r2, CoinDenseVector &rL,
    4                 CoinDenseVector &rU, CoinDenseVector &cL,
    5                 CoinDenseVector &cU ){
     2inline double pdxxxmerit(int nlow, int nupp, int *low, int *upp, CoinDenseVector <double> &r1,
     3                CoinDenseVector <double> &r2, CoinDenseVector <double> &rL,
     4                CoinDenseVector <double> &rU, CoinDenseVector <double> &cL,
     5                CoinDenseVector <double> &cU ){
    66
    77// Evaluate the merit function for Newton's method.
    88// It is the 2-norm of the three sets of residuals.
    99  double sum1, sum2;
    10   CoinDenseVector f(6);
     10  CoinDenseVector <double> f(6);
    1111  f[0] = r1.twoNorm();
    1212  f[1] = r2.twoNorm();
     
    4040inline void pdxxxresid1(ClpPdco *model, const int nlow, const int nupp, const int nfix,
    4141                 int *low, int *upp, int *fix,
    42                  CoinDenseVector &b, double *bl, double *bu, double d1, double d2,
    43                  CoinDenseVector &grad, CoinDenseVector &rL,
    44                  CoinDenseVector &rU, CoinDenseVector &x,
    45                  CoinDenseVector &x1, CoinDenseVector &x2,
    46                  CoinDenseVector &y,  CoinDenseVector &z1,
    47                  CoinDenseVector &z2, CoinDenseVector &r1,
    48                  CoinDenseVector &r2, double *Pinf, double *Dinf){
     42                 CoinDenseVector <double> &b, double *bl, double *bu, double d1, double d2,
     43                 CoinDenseVector <double> &grad, CoinDenseVector <double> &rL,
     44                 CoinDenseVector <double> &rU, CoinDenseVector <double> &x,
     45                 CoinDenseVector <double> &x1, CoinDenseVector <double> &x2,
     46                 CoinDenseVector <double> &y,  CoinDenseVector <double> &z1,
     47                 CoinDenseVector <double> &z2, CoinDenseVector <double> &r1,
     48                 CoinDenseVector <double> &r2, double *Pinf, double *Dinf){
    4949
    5050// Form residuals for the primal and dual equations.
     
    5454// Get some element pointers for efficiency
    5555  double *x_elts  = x.getElements();
    56   double *x1_elts = x2.getElements();
    57   double *x2_elts = x2.getElements();
    58   double *z1_elts = z1.getElements();
    59   double *z2_elts = z2.getElements();
    6056  double *r2_elts = r2.getElements();
    6157 
     
    104100
    105101inline void pdxxxresid2(double mu, int nlow, int nupp, int *low, int *upp,
    106                  CoinDenseVector &cL, CoinDenseVector &cU,
    107                  CoinDenseVector &x1, CoinDenseVector &x2,
    108                  CoinDenseVector &z1, CoinDenseVector &z2,
     102                 CoinDenseVector <double> &cL, CoinDenseVector <double> &cU,
     103                 CoinDenseVector <double> &x1, CoinDenseVector <double> &x2,
     104                 CoinDenseVector <double> &z1, CoinDenseVector <double> &z2,
    109105                 double *center, double *Cinf, double *Cinf0){
    110106
     
    155151//-----------------------------------------------------------------------
    156152
    157 inline double  pdxxxstep( CoinDenseVector &x, CoinDenseVector &dx ){
     153inline double  pdxxxstep( CoinDenseVector <double> &x, CoinDenseVector <double> &dx ){
    158154
    159155// Assumes x > 0.
     
    175171//-----------------------------------------------------------------------
    176172
    177 inline double  pdxxxstep(int nset, int *set, CoinDenseVector &x, CoinDenseVector &dx ){
     173inline double  pdxxxstep(int nset, int *set, CoinDenseVector <double> &x, CoinDenseVector <double> &dx ){
    178174
    179175// Assumes x > 0.
Note: See TracChangeset for help on using the changeset viewer.