Changeset 1613


Ignore:
Timestamp:
Oct 18, 2010 10:55:32 AM (9 years ago)
Author:
lou
Message:

Small changes (remove local static variables) to allow DLL build with Visual Studio

Location:
trunk/Clp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpNode.cpp

    r1525 r1613  
    11601160}
    11611161
    1162 int
    1163 ClpHashValue::hash ( double value) const
    1164 {
    1165      static int mmult[] = {
     1162namespace {
     1163  /*
     1164    Originally a local static variable in ClpHashValue::hash.
     1165        Local static variables are a problem when building DLLs on Windows, but
     1166        file-local constants seem to be ok.  -- lh, 101016 --
     1167  */
     1168  const int mmult_for_hash[] = {
    11661169          262139, 259459, 256889, 254291, 251701, 249133, 246709, 244247,
    11671170          241667, 239179, 236609, 233983, 231289, 228859, 226357, 223829,
     
    11751178          82183, 79939, 77587, 75307, 72959, 70793, 68447, 66103
    11761179     };
     1180}
     1181int
     1182ClpHashValue::hash ( double value) const
     1183{
     1184     
    11771185     union {
    11781186          double d;
     
    11861194     for ( j = 0; j < 8; ++j ) {
    11871195          int ichar = v1.c[j];
    1188           n += mmult[j] * ichar;
     1196          n += mmult_for_hash[j] * ichar;
    11891197     }
    11901198     return ( abs ( n ) % maxHash_ );   /* integer abs */
  • trunk/Clp/src/ClpSimplex.cpp

    r1586 r1613  
    16951695     //}
    16961696     //}
     1697#    ifndef _MSC_VER
     1698         // The local static var k is a problem when trying to build a DLL. Since this is
     1699         // just for debugging (likely done on *nix), just hide it from Windows
     1700         // -- lh, 101016 --
    16971701     if (0)  {
    16981702          static int k = 0;
     
    17081712          k++;
    17091713     }
     1714#    endif
    17101715     int status = factorization_->factorize(this, solveType, valuesPass);
    17111716     if (status) {
Note: See TracChangeset for help on using the changeset viewer.