Changeset 63


Ignore:
Timestamp:
Nov 27, 2002 2:51:11 PM (17 years ago)
Author:
jpfasano
Message:

-modified to use CoinPragma?.h
-modified to compile w/MS Visual C++ and gcc (on cygwin) without errors or warnings.

Location:
trunk
Files:
38 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpDualRowDantzig.cpp

    r50 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
    73
    8 
     4#include "CoinPragma.hpp"
    95#include "ClpSimplex.hpp"
    106#include "ClpDualRowDantzig.hpp"
  • trunk/ClpDualRowPivot.cpp

    r50 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
    73
    8 
     4#include "CoinPragma.hpp"
    95#include "ClpSimplex.hpp"
    106#include "ClpDualRowPivot.hpp"
  • trunk/ClpDualRowSteepest.cpp

    r50 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
    7 
    8 
     3
     4#include "CoinPragma.hpp"
    95#include "ClpSimplex.hpp"
    106#include "ClpDualRowSteepest.hpp"
  • trunk/ClpFactorization.cpp

    r50 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
    73
     4#include "CoinPragma.hpp"
    85#include "ClpFactorization.hpp"
    96#include "CoinHelperFunctions.hpp"
  • trunk/ClpMatrixBase.cpp

    r2 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
     3
     4#include "CoinPragma.hpp"
    75
    86#include <iostream>
  • trunk/ClpMessage.cpp

    r50 r63  
    11// Copyright (C) 2000, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
    73
     4#include "CoinPragma.hpp"
    85#include "ClpMessage.hpp"
    96
  • trunk/ClpModel.cpp

    r55 r63  
    1010
    1111#include <time.h>
    12 #if defined(_MSC_VER)
    13 // Turn off compiler warning about long names
    14 #  pragma warning(disable:4786)
    15 #else
     12
     13#include "CoinPragma.hpp"
     14#ifndef _MSC_VER
    1615#include <sys/times.h>
    1716#include <sys/resource.h>
  • trunk/ClpNonLinearCost.cpp

    r54 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
    7 
     3
     4#include "CoinPragma.hpp"
    85#include <iostream>
    96
  • trunk/ClpPackedMatrix.cpp

    r50 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
     3
    74
    85#include <cstdio>
    96
     7#include "CoinPragma.hpp"
    108#include "CoinIndexedVector.hpp"
    119#include "CoinHelperFunctions.hpp"
  • trunk/ClpPrimalColumnDantzig.cpp

    r50 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
     3
     4#include "CoinPragma.hpp"
    75
    86#include <cstdio>
  • trunk/ClpPrimalColumnPivot.cpp

    r50 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
    73
     4#include "CoinPragma.hpp"
    85
    96#include "ClpSimplex.hpp"
  • trunk/ClpPrimalColumnSteepest.cpp

    r50 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
    7 
     3
     4#include "CoinPragma.hpp"
    85
    96#include "ClpSimplex.hpp"
  • trunk/ClpSimplex.cpp

    r57 r63  
    44
    55
    6 #if defined(_MSC_VER)
    7 // Turn off compiler warning about long names
    8 #  pragma warning(disable:4786)
    9 #endif
     6
     7#include "CoinPragma.hpp"
    108
    119#include <math.h>
  • trunk/ClpSimplexDual.cpp

    r56 r63  
    8787 */
    8888
    89 #if defined(_MSC_VER)
    90 // Turn off compiler warning about long names
    91 #  pragma warning(disable:4786)
    92 #endif
     89
     90#include "CoinPragma.hpp"
    9391
    9492#include <math.h>
  • trunk/ClpSimplexPrimal.cpp

    r57 r63  
    7777 */
    7878
    79 #if defined(_MSC_VER)
    80 // Turn off compiler warning about long names
    81 #  pragma warning(disable:4786)
    82 #endif
     79
     80#include "CoinPragma.hpp"
    8381
    8482#include <math.h>
  • trunk/IdiSolve.cpp

    r56 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
     3
     4#include "CoinPragma.hpp"
    75#include <stdio.h>
    86#include <stdarg.h>
     
    345343      // for next pass
    346344      direction = - direction;
    347       // randomize
    348       int kcol = ncols*CoinDrand48();
     345      // randomize.
     346      // The cast is to avoid gcc compiler warning
     347      int kcol = (int)(ncols*CoinDrand48());
    349348      if (kcol==ncols)
    350349        kcol=ncols-1;
     
    413412                    nsign++;
    414413                    if (fabs(diff1)<=fabs(diff2)) {
    415                       int ii=fabs(4.0*diff1/diff2);
     414          // cast is to avoid gcc compiler
     415          // warning: initialization to 'int' from 'double'
     416                      int ii=(int)fabs(4.0*diff1/diff2);
    416417                      if (ii==4) ii=3;
    417418                      mgood[ii]++;
  • trunk/Idiot.cpp

    r56 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
     3
     4#include "CoinPragma.hpp"
    75#include <stdio.h>
    86#include <stdarg.h>
     
    146144  maxIts2_=105;
    147145  if (numberPass<=0)
    148     majorIterations_=2+log10(numberColumns+1);
     146    // Cast to avoid gcc compiler warning
     147    majorIterations_=(int)(2+log10(numberColumns+1));
    149148  else
    150149    majorIterations_=numberPass;
  • trunk/PresolveDoubleton.cpp

    r61 r63  
    783783  delete[]zeros;
    784784  delete[]fixed;
    785   deleteAction(actions);
     785  deleteAction(actions,action*);
    786786
    787787  return (next);
     
    10681068    delete[]actions_[i].indy;
    10691069  }
    1070   deleteAction(actions_);
     1070  deleteAction(actions_,action*);
    10711071}
    10721072
  • trunk/PresolveDupcol.cpp

    r57 r63  
    417417    next = new dupcol_action(nactions, copyOfArray(actions,nactions), next);
    418418  }
    419   deleteAction(actions);
     419  deleteAction(actions,action*);
    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   deleteAction(actions);
     701  deleteAction(actions,action*);
    702702  return (next);
    703703}
  • trunk/PresolveFixed.cpp

    r57 r63  
    124124    delete[]actions_[i].colels;
    125125  }
    126   deleteAction(actions_);
     126  deleteAction(actions_,action*);
    127127}
    128128
  • trunk/PresolveForcing.cpp

    r57 r63  
    345345                                         copyOfArray(actions,nactions), next);
    346346  }
    347   deleteAction(actions);
     347  deleteAction(actions,action*);
    348348  if (nuseless_rows) {
    349349    next = useless_constraint_action::presolve(prob,
  • trunk/PresolveImpliedFree.cpp

    r61 r63  
    324324    next = new implied_free_action(nactions, copyOfArray(actions,nactions), next);
    325325  }
    326   deleteAction(actions);
     326  deleteAction(actions,action*);
    327327
    328328  delete[]ilbound;
     
    435435      rup[irow] = f->rup;
    436436    }
    437     deleteAction( save_costs);
     437    deleteAction( save_costs,double*);
    438438    // coeff has now been initialized
    439439
  • trunk/PresolveSubst.cpp

    r62 r63  
    10311031  }
    10321032  delete [] look2;
    1033   deleteAction(actions);
     1033  deleteAction(actions,action*);
    10341034
    10351035  delete[]x_to_y;
     
    13441344    delete[]actions[i].rowcolsxs;
    13451345    delete[]actions[i].rowelsxs;
    1346     delete[]actions[i].costsx;
     1346
     1347
     1348    //delete [](double*)actions[i].costsx;
     1349    deleteAction(actions[i].costsx,double*);
    13471350  }
    13481351
    1349   //deleteAction(actions_);
    1350   delete [] (subst_constraint_action::action *) actions_;
     1352  // Must add cast to placate MS compiler
     1353  //delete [] (subst_constraint_action::action*)actions_;
     1354  deleteAction(actions_,subst_constraint_action::action*);
    13511355}
  • trunk/README

    r2 r63  
    77make unitTest in this directory.  This creates an executable clp.
    88
    9 Doing clp gives you some hints.  It can do a unit test and solve netlib problems.  It can also solve problems and set tolerances etc.  Just do clp - and then try ? or setting various stuff.
     9Running clp gives you some hints.  It can do a unit test and solve netlib problems.  It can also solve problems and set tolerances etc.  Just do clp - and then try ? or setting various stuff.
    1010
    1111On Linux clp can do file completion and line editing. 
  • trunk/Test/ClpMain.cpp

    r57 r63  
    11// Copyright (C) 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    3 #if defined(_MSC_VER)
    4 // Turn off compiler warning about long names
    5 #  pragma warning(disable:4786)
    6 #endif
     3
     4#include "CoinPragma.hpp"
    75
    86#include <cassert>
     
    1513#include <time.h>
    1614
    17 #if defined(_MSC_VER)
    18 // Turn off compiler warning about long names
    19 #  pragma warning(disable:4786)
    20 #else
     15#include "CoinPragma.hpp"
     16#ifndef _MSC_VER
    2117#include <sys/times.h>
    2218#include <sys/resource.h>
  • trunk/Test/unitTest.cpp

    r55 r63  
    1010
    1111#include <time.h>
    12 #if defined(_MSC_VER)
    13 // Turn off compiler warning about long names
    14 #  pragma warning(disable:4786)
    15 #endif
     12
     13#include "CoinPragma.hpp"
    1614
    1715#include "CoinMpsIO.hpp"
  • trunk/include/ClpFactorization.hpp

    r50 r63  
    44#define ClpFactorization_H
    55
    6 #if defined(_MSC_VER)
    7 // Turn off compiler warning about long names
    8 #  pragma warning(disable:4786)
    9 #endif
     6
     7#include "CoinPragma.hpp"
    108
    119#include "CoinFactorization.hpp"
  • trunk/include/ClpMatrixBase.hpp

    r61 r63  
    44#define ClpMatrixBase_H
    55
    6 #if defined(_MSC_VER)
    7 // Turn off compiler warning about long names
    8 #  pragma warning(disable:4786)
    9 #endif
     6#include "CoinPragma.hpp"
    107
    118#include "CoinPackedMatrix.hpp"
  • trunk/include/ClpMessage.hpp

    r50 r63  
    44#define ClpMessage_H
    55
    6 #if defined(_MSC_VER)
    7 // Turn off compiler warning about long names
    8 #  pragma warning(disable:4786)
    9 #endif
     6
     7#include "CoinPragma.hpp"
    108
    119/** This deals with Clp messages (as against Osi messages etc)
  • trunk/include/ClpNonLinearCost.hpp

    r54 r63  
    44#define ClpNonLinearCost_H
    55
    6 #if defined(_MSC_VER)
    7 // Turn off compiler warning about long names
    8 #  pragma warning(disable:4786)
    9 #endif
     6
     7#include "CoinPragma.hpp"
    108
    119class ClpSimplex;
  • trunk/include/ClpPackedMatrix.hpp

    r50 r63  
    44#define ClpPackedMatrix_H
    55
    6 #if defined(_MSC_VER)
    7 // Turn off compiler warning about long names
    8 #  pragma warning(disable:4786)
    9 #endif
     6
     7#include "CoinPragma.hpp"
    108
    119#include "ClpMatrixBase.hpp"
  • trunk/include/PresolveEmpty.hpp

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

    r57 r63  
    7777  void postsolve(PostsolveMatrix *prob) const;
    7878
    79   ~make_fixed_action() { deleteAction(actions_); delete faction_;};
     79  ~make_fixed_action() {
     80    deleteAction(actions_,action*);
     81    delete faction_;
     82  };
    8083};
    8184
  • trunk/include/PresolveForcing.hpp

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

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

    r61 r63  
    44#define PresolveMatrix_H
    55
     6#include "CoinPragma.hpp"
    67#include "ClpSimplex.hpp"
    78
    89#include <cmath>
    910#include <cfloat>
     11
    1012#if defined(_MSC_VER)
    11 // Turn off compiler warning about long names
    12 #  pragma warning(disable:4786)
    13 // Visual C++ has bad bug on delete []
    14 #define deleteAction(array) delete [] ((void *) array)
     13// Avoid MS Compiler problem in recognizing type to delete
     14// by casting to type.
     15#define deleteAction(array,type) delete [] ((type) array)
    1516#else
    16 // Visual C++ has bad bug on delete []
    17 #define deleteAction(array) delete [] array
     17#define deleteAction(array,type) delete [] array
    1818#endif
    1919
  • trunk/include/PresolveSingleton.hpp

    r57 r63  
    4444
    4545
    46   ~slack_doubleton_action() { deleteAction(actions_); }
     46  ~slack_doubleton_action() { deleteAction(actions_,action*); }
    4747};
    4848#endif
  • trunk/include/PresolveZeros.hpp

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