Changeset 57


Ignore:
Timestamp:
Nov 25, 2002 1:41:10 PM (17 years ago)
Author:
forrest
Message:

Yet more changes for Visual C++

Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpSimplex.cpp

    r50 r57  
    19781978ClpSimplex::sparseFactorization() const
    19791979{
    1980   return factorization_->sparseThreshold();
     1980  return factorization_->sparseThreshold()!=0;
    19811981}
    19821982void
  • trunk/ClpSimplexPrimal.cpp

    r56 r57  
    247247      // for this we need clean basis so it is after factorize
    248248      numberThrownOut=gutsOfSolution(rowActivityWork_,columnActivityWork_,
    249                                      ifValuesPass);
     249                                     ifValuesPass!=0);
    250250      totalNumberThrownOut+= numberThrownOut;
    251251     
  • trunk/Presolve.cpp

    r50 r57  
    527527
    528528  if (!prob->status_) {
    529     const bool slackd = ATOI("SLACKD");
    530     //const bool forcing = ATOI("FORCING");
    531     const bool doubleton = ATOI("DOUBLETON");
    532     const bool forcing = ATOI("off");
    533     const bool ifree = ATOI("off");
    534     const bool zerocost = ATOI("off");
    535     const bool dupcol = ATOI("off");
    536     const bool duprow = ATOI("off");
    537     const bool dual = ATOI("off");
     529    const bool slackd = ATOI("SLACKD")!=0;
     530    //const bool forcing = ATOI("FORCING")!=0;
     531    const bool doubleton = ATOI("DOUBLETON")!=0;
     532    const bool forcing = ATOI("off")!=0;
     533    const bool ifree = ATOI("off")!=0;
     534    const bool zerocost = ATOI("off")!=0;
     535    const bool dupcol = ATOI("off")!=0;
     536    const bool duprow = ATOI("off")!=0;
     537    const bool dual = ATOI("off")!=0;
    538538   
    539539    // some things are expensive so just do once (normally)
  • trunk/PresolveDoubleton.cpp

    r56 r57  
    793793  delete[]zeros;
    794794  delete[]fixed;
    795   delete [] actions;
     795  deleteAction(actions);
    796796
    797797  return (next);
     
    10781078    delete[]actions_[i].indy;
    10791079  }
    1080   delete[]actions_;
     1080  deleteAction(actions_);
    10811081}
    10821082
  • trunk/PresolveDupcol.cpp

    r56 r57  
    417417    next = new dupcol_action(nactions, copyOfArray(actions,nactions), next);
    418418  }
    419   delete [] actions;
     419  deleteAction(actions);
    420420  if (nfixed_down)
    421421    next = make_fixed_action::presolve(prob, fixed_down, nfixed_down,
     
    699699    next = new duprow_action(nactions, copyOfArray(actions,nactions), next);
    700700  }
    701   delete [] actions;
     701  deleteAction(actions);
    702702  return (next);
    703703}
  • trunk/PresolveFixed.cpp

    r56 r57  
    103103  remove_fixed_action * nextAction =  new
    104104    remove_fixed_action(nfcols, actions, next);
    105   delete [] actions;
     105  delete [] (void *) actions;
    106106  return nextAction;
    107107#else
     
    124124    delete[]actions_[i].colels;
    125125  }
    126   delete[]actions_;
     126  deleteAction(actions_);
    127127}
    128128
  • trunk/PresolveForcing.cpp

    r56 r57  
    298298        int lk = krs;   // load fix-to-down in front
    299299        int uk = kre;   // load fix-to-up in back
    300 
    301         for (CoinBigIndex k=krs; k<kre; k++) {
     300        CoinBigIndex k;
     301        for ( k=krs; k<kre; k++) {
    302302          int jcol = hcol[k];
    303303          prob->addCol(jcol);
     
    345345                                         copyOfArray(actions,nactions), next);
    346346  }
    347   delete [] actions;
     347  deleteAction(actions);
    348348  if (nuseless_rows) {
    349349    next = useless_constraint_action::presolve(prob,
     
    492492    double maxup = 0.0;
    493493    double maxdown = 0.0;
    494 
    495     for (CoinBigIndex k=krs; k<kre; k++) {
     494    CoinBigIndex k;
     495    for (k=krs; k<kre; k++) {
    496496      int jcol = hcol[k];
    497497      double coeff = rowels[k];
     
    586586    }
    587587
    588     for (CoinBigIndex k = krs; k<kre; ++k) {
     588    for (k = krs; k<kre; ++k) {
    589589      int jcol = hcol[k];
    590590      double coeff = rowels[k];
     
    624624    }
    625625
    626     for (CoinBigIndex k = krs; k<kre; ++k) {
     626    for (k = krs; k<kre; ++k) {
    627627      int jcol = hcol[k];
    628628      double coeff = rowels[k];
  • trunk/PresolveImpliedFree.cpp

    r56 r57  
    323323    next = new implied_free_action(nactions, copyOfArray(actions,nactions), next);
    324324  }
    325   delete [] actions;
     325  deleteAction(actions);
    326326
    327327  delete[]ilbound;
  • trunk/PresolveIsolated.cpp

    r56 r57  
    5252    return NULL;
    5353  }
    54   for (CoinBigIndex k = krs; k<kre; ++k) {
     54  CoinBigIndex k;
     55  for ( k = krs; k<kre; ++k) {
    5556    int jcol = hcol[k];
    5657    if (clo[jcol] != 0.0 && cup[jcol] != 0.0) {
     
    8384  // HACK - set costs to 0.0 so empty.cpp doesn't complain
    8485  double *costs = new double[nc];
    85   for (CoinBigIndex k = krs; k<kre; ++k) {
     86  for (k = krs; k<kre; ++k) {
    8687    costs[k-krs] = dcost[hcol[k]];
    8788    dcost[hcol[k]] = 0.0;
     
    9596                                        next);
    9697
    97   for (CoinBigIndex k=krs; k<kre; k++)
     98  for ( k=krs; k<kre; k++)
    9899    presolve_delete_from_row(hcol[k], irow, mcstrt, hincol, hrow, colels);
    99100  hinrow[irow] = 0;
  • trunk/PresolveSubst.cpp

    r56 r57  
    651651        int nfill = -hinrow[bestrowy_row];
    652652        CoinBigIndex kcol1 = krs1;
    653         for (CoinBigIndex kk=krs; kk<kre; ++kk) {
     653        CoinBigIndex kk;
     654        for (kk=krs; kk<kre; ++kk) {
    654655          int jcol = hcol[kk];
    655656
     
    660661        }
    661662        CoinBigIndex kcol2 = krs2;
    662         for (CoinBigIndex kk=krs; kk<kre; ++kk) {
     663        for (kk=krs; kk<kre; ++kk) {
    663664          int jcol = hcol[kk];
    664665
     
    10351036  }
    10361037  delete [] look2;
    1037   delete [] actions;
     1038  deleteAction(actions);
    10381039
    10391040  delete[]x_to_y;
     
    13511352  }
    13521353
    1353   delete[]actions;
    1354 
     1354  deleteAction(actions_);
    13551355}
  • trunk/PresolveTighten.cpp

    r56 r57  
    298298
    299299    PRESOLVEASSERT(prob->getColumnStatus(jcol)!=PrePostsolveMatrix::basic);
    300     for (int i=0;i<nr; ++i) {
     300    int i;
     301    for (i=0;i<nr; ++i) {
    301302      int irow = rows[i];
    302303
     
    321322    CoinBigIndex k = mcstrt[jcol];
    322323    int nk = hincol[jcol];
    323     for (int i=0; i<nk; ++i) {
     324    for (i=0; i<nk; ++i) {
    324325      int irow = hrow[k];
    325326      double coeff = colels[k];
     
    355356    // now adjust the activities
    356357    k = mcstrt[jcol];
    357     for (int i=0; i<nk; ++i) {
     358    for (i=0; i<nk; ++i) {
    358359      int irow = hrow[k];
    359360      double coeff = colels[k];
  • trunk/PresolveZeros.cpp

    r55 r57  
    2424  typedef dropped_zero action;
    2525  int nactions = 0;
     26  int i;
    2627
    27   for (int i=0; i<ncheckcols; i++) {
     28  for (i=0; i<ncheckcols; i++) {
    2829    int col = checkcols[i];
    2930    CoinBigIndex kcs = mcstrt[col];
     
    6768                    int *hincol)
    6869{
    69   for (int i=0; i<nzeros; i++) {
     70  int i;
     71  for (i=0; i<nzeros; i++) {
    7072    int col = zeros[i].row;
    7173    CoinBigIndex kcs = mcstrt[col];
  • trunk/Test/ClpMain.cpp

    r55 r57  
    10691069              break;
    10701070            case SPARSEFACTOR:
    1071               models[iModel].setSparseFactorization(1-action);
     1071              models[iModel].setSparseFactorization((1-action)!=0);
    10721072              break;
    10731073            case ERRORSALLOWED:
     
    12421242              if (canOpen) {
    12431243                int status =models[iModel].readMps(fileName.c_str(),
    1244                                                    keepImportNames,
    1245                                                    allowImportErrors);
     1244                                                   keepImportNames!=0,
     1245                                                   allowImportErrors!=0);
    12461246                if (!status||(status>0&&allowImportErrors)) {
    12471247                  goodModels[iModel]=true;
  • trunk/include/PresolveEmpty.hpp

    r50 r57  
    4646  void postsolve(PostsolveMatrix *prob) const;
    4747
    48   ~drop_empty_cols_action() { delete[]actions_; }
     48  ~drop_empty_cols_action() { deleteAction(actions_); }
    4949};
    5050
     
    7878  void postsolve(PostsolveMatrix *prob) const;
    7979
    80   ~drop_empty_rows_action() { delete[]actions_; }
     80  ~drop_empty_rows_action() { deleteAction(actions_); }
    8181};
    8282#endif
  • trunk/include/PresolveFixed.hpp

    r50 r57  
    7777  void postsolve(PostsolveMatrix *prob) const;
    7878
    79   ~make_fixed_action() { delete[]actions_; delete faction_;};
     79  ~make_fixed_action() { deleteAction(actions_); delete faction_;};
    8080};
    8181
  • trunk/include/PresolveForcing.hpp

    r50 r57  
    3232  void postsolve(PostsolveMatrix *prob) const;
    3333
    34   ~forcing_constraint_action() { delete[]actions_; }
     34  ~forcing_constraint_action() { deleteAction(actions_); }
    3535};
    3636
  • trunk/include/PresolveImpliedFree.hpp

    r50 r57  
    3535  void postsolve(PostsolveMatrix *prob) const;
    3636
    37   ~implied_free_action() { delete[]actions_; }
     37  ~implied_free_action() { deleteAction(actions_); }
    3838};
    3939
  • trunk/include/PresolveMatrix.hpp

    r56 r57  
    1717#define max(a,b)  (((a) > (b)) ? (a) : (b))
    1818#endif
     19#define bcopy(dest, src, count) memcpy(dest, src, count)
     20#define bzero(dest, count) memset(dest, 0, count)
     21// Visual C++ has bad bug on delete []
     22#define deleteAction(array) delete [] (void *) array
    1923#else
    2024using std::min;
    2125using std::max;
     26// Visual C++ has bad bug on delete []
     27#define deleteAction(array) delete [] array
     28#
    2229#endif
    2330
  • trunk/include/PresolveSingleton.hpp

    r50 r57  
    4444
    4545
    46   ~slack_doubleton_action() { delete[]actions_; }
     46  ~slack_doubleton_action() { deleteAction(actions_); }
    4747};
    4848#endif
Note: See TracChangeset for help on using the changeset viewer.