Changeset 61


Ignore:
Timestamp:
Nov 27, 2002 11:49:03 AM (18 years ago)
Author:
forrest
Message:

Still trying to clean up VC++ and min/max

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/PresolveDoubleton.cpp

    r60 r61  
    1515#include "PresolvePsdebug.hpp"
    1616#include "ClpMessage.hpp"
    17 
    18 inline double max(double x, double y)
    19 {
    20   return (x < y) ? y : x;
    21 }
    22 
    23 inline double min(double x, double y)
    24 {
    25   return (x < y) ? x : y;
    26 }
    2717
    2818void compact_rep(double *elems, int *indices, CoinBigIndex *starts, const int *lengths, int n,
     
    457447     
    458448      // don't bother with fixed variables
    459       if ((!fabs(cup[icolx] - clo[icolx]) < ZTOLDP) &&
    460           (!fabs(cup[icoly] - clo[icoly]) < ZTOLDP)) {
     449      if (!(fabs(cup[icolx] - clo[icolx]) < ZTOLDP) &&
     450          !(fabs(cup[icoly] - clo[icoly]) < ZTOLDP)) {
    461451        double coeffx, coeffy;
    462452        /* find this row in each of the columns */
  • trunk/PresolveImpliedFree.cpp

    r59 r61  
    435435      rup[irow] = f->rup;
    436436    }
    437     delete [] save_costs;
     437    deleteAction( save_costs);
    438438    // coeff has now been initialized
    439439
  • trunk/PresolveSubst.cpp

    r60 r61  
    3434                 const presolvehlink *link);
    3535
    36 inline int min(int x, int y)
    37 {
    38   return (x < y) ? x : y;
    39 }
    4036
    4137
     
    615611
    616612      bool all_ok = true;
    617       for (CoinBigIndex k=kcs; k<kce; ++k) {
     613      for (k=kcs; k<kce; ++k) {
    618614        double coeff_factor = fabs(colels[k] / bestrowy_coeff);
    619615        if (fabs(coeff_factor) > 1.3)
     
    651647        int nfill = -hinrow[bestrowy_row];
    652648        CoinBigIndex kcol1 = krs1;
    653         CoinBigIndex kk;
    654649        for (kk=krs; kk<kre; ++kk) {
    655650          int jcol = hcol[kk];
     
    838833            // Use ap as mcstrt etc may move if compacted
    839834            kce = hincol[jcoly];
    840             CoinBigIndex k;
    841835            action *ap = &actions[nactions-1];
    842836            for (k=0; k<kce; ++k) {
  • trunk/PresolveZeros.cpp

    r57 r61  
    99#include "PresolveZeros.hpp"
    1010
    11 inline double min(double x, double y)
    12 {
    13   return (x < y) ? x : y;
    14 }
    1511
    1612// searches the cols in checkcols for zero entries.
  • trunk/include/ClpMatrixBase.hpp

    r55 r61  
    77// Turn off compiler warning about long names
    88#  pragma warning(disable:4786)
    9 #if !defined(min)
    10 #define min(a,b)  (((a) < (b)) ? (a) : (b))
    11 #endif
    12 #if !defined(max)
    13 #define max(a,b)  (((a) > (b)) ? (a) : (b))
    14 #endif
    15 double drand48(void);
    16 #else
    17 using std::min;
    18 using std::max;
    199#endif
    2010
  • trunk/include/Idiot.hpp

    r56 r61  
    2121  int iteration;
    2222} IdiotResult;
    23 using std::max;
    24 using std::min;
    2523/** This class implements a very silly algorithm.  It has no merit
    2624    apart from the fact that it gets an approximate solution to
  • trunk/include/PresolveMatrix.hpp

    r59 r61  
    1111// Turn off compiler warning about long names
    1212#  pragma warning(disable:4786)
    13 #if !defined(min)
    14 #define min(a,b)  (((a) < (b)) ? (a) : (b))
    15 #endif
    16 #if !defined(max)
    17 #define max(a,b)  (((a) > (b)) ? (a) : (b))
    18 #endif
    1913// Visual C++ has bad bug on delete []
    20 #define deleteAction(array) delete [] (void *) array
     14#define deleteAction(array) delete [] ((void *) array)
    2115#else
    22 using std::min;
    23 using std::max;
    2416// Visual C++ has bad bug on delete []
    2517#define deleteAction(array) delete [] array
    26 #
    2718#endif
    2819
  • trunk/include/PresolveZeros.hpp

    r50 r61  
    2929  void postsolve(PostsolveMatrix *prob) const;
    3030
    31   ~drop_zero_coefficients_action() { delete[]zeros_; }
     31  ~drop_zero_coefficients_action() { deleteAction(zeros_); }
    3232};
    3333
Note: See TracChangeset for help on using the changeset viewer.