Changeset 1893 for stable


Ignore:
Timestamp:
Nov 22, 2012 1:22:50 PM (7 years ago)
Author:
forrest
Message:

more special options

Location:
stable/1.14/Clp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable/1.14/Clp/src/CbcOrClpParam.cpp

    r1886 r1893  
    55
    66#include "CoinPragma.hpp"
     7#include "CoinTime.hpp"
    78#include "CbcOrClpParam.hpp"
    89
     
    600601          case CLP_PARAM_INT_SPECIALOPTIONS:
    601602               model->setSpecialOptions(value);
     603          case CLP_PARAM_INT_RANDOMSEED:
     604            {
     605              if (value==0) {
     606                double time = fabs(CoinGetTimeOfDay());
     607                while (time>=COIN_INT_MAX)
     608                  time *= 0.5;
     609                value = static_cast<int>(time);
     610                sprintf(printArray, "using time of day %s was changed from %d to %d",
     611                  name_.c_str(), oldValue, value);
     612              }
     613              model->setRandomSeed(value);
     614            }
     615               break;
     616          case CLP_PARAM_INT_MORESPECIALOPTIONS:
     617               model->setMoreSpecialOptions(value);
     618               break;
    602619#ifndef COIN_HAS_CBC
    603620#ifdef CBC_THREAD
     
    636653          value = model->specialOptions();
    637654          break;
     655     case CLP_PARAM_INT_RANDOMSEED:
     656          value = model->randomNumberGenerator()->getSeed();
     657          break;
     658     case CLP_PARAM_INT_MORESPECIALOPTIONS:
     659          value = model->moreSpecialOptions();
     660          break;
    638661#ifndef COIN_HAS_CBC
    639662#ifdef CBC_THREAD
    640663     case CBC_PARAM_INT_THREADS:
    641664          value = model->numberThreads();
     665          break;
    642666#endif
    643667#endif
     
    901925#endif
    902926#endif
     927          case CBC_PARAM_INT_RANDOMSEED:
     928               oldValue = model.getRandomSeed();
     929               model.setRandomSeed(value);
     930               break;
    903931          default:
    904932               break;
     
    949977     case CBC_PARAM_INT_THREADS:
    950978          value = model.getNumberThreads();
    951 #endif
    952 #endif
     979          break;
     980#endif
     981#endif
     982     case CBC_PARAM_INT_RANDOMSEED:
     983          value = model.getRandomSeed();
     984          break;
    953985     default:
    954986          value = intValue_;
     
    24302462haroldo.santos@gmail.com.\
    24312463");
     2464#endif
     2465     parameters[numberParameters++] =
     2466          CbcOrClpParam("moreS!pecialOptions", "Yet more dubious options for Simplex - see ClpSimplex.hpp",
     2467                        0, COIN_INT_MAX, CLP_PARAM_INT_MORESPECIALOPTIONS, 0);
     2468#ifdef COIN_HAS_CBC
    24322469     parameters[numberParameters++] =
    24332470          CbcOrClpParam("moreT!une", "Yet more dubious ideas for feasibility pump",
     
    29322969#ifdef COIN_HAS_CBC
    29332970     parameters[numberParameters++] =
     2971          CbcOrClpParam("randomC!bcSeed", "Random seed for Cbc",
     2972                        -1, COIN_INT_MAX, CBC_PARAM_INT_RANDOMSEED);
     2973     parameters[numberParameters-1].setLonghelp
     2974     (
     2975          "This sets a random seed for Cbc \
     2976- 0 says use time of day, -1 is as now."
     2977     );
     2978     parameters[numberParameters-1].setIntValue(-1);
     2979     parameters[numberParameters++] =
    29342980          CbcOrClpParam("rand!omizedRounding", "Whether to try randomized rounding heuristic",
    29352981                        "off", CBC_PARAM_STR_RANDROUND);
     
    29412987          "stuff needed. \
    29422988Doh option does heuristic before preprocessing"     );
     2989#endif
     2990#ifdef COIN_HAS_CLP
     2991     parameters[numberParameters++] =
     2992          CbcOrClpParam("randomS!eed", "Random seed for Clp",
     2993                        0, COIN_INT_MAX, CLP_PARAM_INT_RANDOMSEED);
     2994     parameters[numberParameters-1].setLonghelp
     2995     (
     2996          "This sets a random seed for Clp \
     2997- 0 says use time of day."
     2998     );
     2999     parameters[numberParameters-1].setIntValue(1234567);
     3000#endif
     3001#ifdef COIN_HAS_CBC
    29433002     parameters[numberParameters++] =
    29443003          CbcOrClpParam("ratio!Gap", "Stop when gap between best possible and \
  • stable/1.14/Clp/src/CbcOrClpParam.hpp

    r1886 r1893  
    101101     CLP_PARAM_INT_PROCESSTUNE,
    102102     CLP_PARAM_INT_USESOLUTION,
     103     CLP_PARAM_INT_RANDOMSEED,
     104     CLP_PARAM_INT_MORESPECIALOPTIONS,
    103105
    104106     CBC_PARAM_INT_STRONGBRANCHING = 151,
     
    135137#endif
    136138     CBC_PARAM_INT_MAXSAVEDSOLS,
     139     CBC_PARAM_INT_RANDOMSEED,
    137140
    138141     CLP_PARAM_STR_DIRECTION = 201,
     
    475478void CoinReadPrintit(const char * input);
    476479void setCbcOrClpPrinting(bool yesNo);
    477 #define CBCMAXPARAMETERS 200
     480#define CBCMAXPARAMETERS 250
    478481/*
    479482  Subroutine to establish the cbc parameter array. See the description of
Note: See TracChangeset for help on using the changeset viewer.