Changeset 1267 for trunk


Ignore:
Timestamp:
Sep 5, 2008 11:25:55 AM (12 years ago)
Author:
forrest
Message:

changes for mahdi's heuristics

Location:
trunk/Clp/src
Files:
6 edited

Legend:

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

    r1266 r1267  
    22672267     "By default clp uses Forrest-Tomlin L-U update.  If you are masochistic you can switch it off."
    22682268     );
     2269#endif
     2270#ifdef COIN_HAS_CBC
     2271  parameters[numberParameters++]=
     2272      CbcOrClpParam("pivot!AndFix","Whether to try Pivot and Fix heuristic",
     2273                    "off",PIVOTANDFIX);
     2274  parameters[numberParameters-1].append("on");
     2275  parameters[numberParameters-1].append("do");
     2276  parameters[numberParameters-1].setLonghelp
     2277    (
     2278     "stuff needed."
     2279     );
     2280#endif
     2281#ifdef COIN_HAS_CLP
    22692282  parameters[numberParameters++]=
    22702283    CbcOrClpParam("plus!Minus","Tries to make +- 1 matrix",
     
    24682481     );
    24692482#ifdef COIN_HAS_CBC
     2483  parameters[numberParameters++]=
     2484      CbcOrClpParam("rand!omizedRounding","Whether to try randomized rounding heuristic",
     2485                    "off",RANDROUND);
     2486  parameters[numberParameters-1].append("on");
     2487  parameters[numberParameters-1].append("do");
     2488  parameters[numberParameters-1].setLonghelp
     2489    (
     2490     "stuff needed."
     2491     );
    24702492  parameters[numberParameters++]=
    24712493    CbcOrClpParam("ratio!Gap","Stop when gap between best possible and \
  • trunk/Clp/src/CbcOrClpParam.hpp

    r1266 r1267  
    8080    TWOMIRCUTS,PREPROCESS,FPUMP,GREEDY,COMBINE,LOCALTREE,SOS,
    8181    LANDPCUTS,RINS,RESIDCUTS,RENS,DIVINGS,DIVINGC,DIVINGF,DIVINGG,DIVINGL,
    82     DIVINGP,DIVINGV,DINS,
     82    DIVINGP,DIVINGV,DINS,PIVOTANDFIX,RANDROUND,
    8383   
    8484    DIRECTORY=301,DIRSAMPLE,DIRNETLIB,DIRMIPLIB,IMPORT,EXPORT,RESTORE,SAVE,DUALSIMPLEX,PRIMALSIMPLEX,EITHERSIMPLEX,
  • trunk/Clp/src/ClpModel.cpp

    r1266 r1267  
    7373  integerType_(NULL),
    7474  userPointer_(NULL),
     75  trustedUserPointer_(NULL),
    7576  numberIterations_(0),
    7677  solveType_(0),
     
    755756  numberColumns_ = rhs.numberColumns_;
    756757  userPointer_ = rhs.userPointer_;
     758  trustedUserPointer_ = rhs.trustedUserPointer_;
    757759  scalingFlag_ = rhs.scalingFlag_;
    758760  specialOptions_ = rhs.specialOptions_;
     
    31523154  numberColumns_ = numberColumns;
    31533155  userPointer_ = rhs->userPointer_;
     3156  trustedUserPointer_ = rhs->trustedUserPointer_;
    31543157  numberThreads_=0;
    31553158#ifndef CLP_NO_STD
  • trunk/Clp/src/ClpModel.hpp

    r1205 r1267  
    653653  inline void * getUserPointer () const
    654654  { return userPointer_;}
     655  /// Trusted user pointer
     656  inline void setTrustedUserPointer (ClpTrustedData * pointer)
     657  { trustedUserPointer_=pointer;}
     658  inline ClpTrustedData * getTrustedUserPointer () const
     659  { return trustedUserPointer_;}
    655660  /// What has changed in model (only for masochistic users)
    656661  inline int whatsChanged() const
     
    975980  /// User pointer for whatever reason
    976981  void * userPointer_;
     982  /// Trusted user pointer e.g. for heuristics
     983  ClpTrustedData * trustedUserPointer_;
    977984  /// Array of integer parameters
    978985  int intParam_[ClpLastIntParam];
  • trunk/Clp/src/ClpParameters.hpp

    r1015 r1267  
    114114  }
    115115}
     116/// For a structure to be used by trusted code
     117typedef struct {
     118  int typeStruct; // allocated as 1,2 etc
     119  int typeCall;
     120  void * data;
     121} ClpTrustedData;
    116122#endif
  • trunk/Clp/src/ClpSimplex.cpp

    r1266 r1267  
    16961696    handler_->message()<<CoinMessageEol;
    16971697  }
    1698 #ifdef COIN_FACTORIZATION_INFO
    1699 #define COMPUTE_INT_INFEAS
    1700 #endif
    1701 #ifdef COMPUTE_INT_INFEAS
    1702   if (userPointer_) {
     1698  if (trustedUserPointer_&&trustedUserPointer_->typeStruct==1) {
    17031699    if (algorithm_>0&&integerType_&&!nonLinearCost_->numberInfeasibilities()) {
    17041700      if (fabs(theta_)>1.0e-6||!numberIterations_) {
     
    17111707          int * numberUnsatisfied;
    17121708        } clpSolution;
    1713         clpSolution * solution = (clpSolution *) userPointer_;
     1709        clpSolution * solution = (clpSolution *) trustedUserPointer_->data;
    17141710        if (solution->numberSolutions==solution->maximumSolutions) {
    17151711          int n =  solution->maximumSolutions;
     
    17731769    }
    17741770  }
    1775 #endif
    17761771  if (hitMaximumIterations())
    17771772    return 2;
Note: See TracChangeset for help on using the changeset viewer.