Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/2.8/Cbc/src/CbcModel.hpp

    r1795 r1902  
    1414#include "CoinWarmStartBasis.hpp"
    1515#include "CbcCompareBase.hpp"
     16#include "CbcCountRowCut.hpp"
    1617#include "CbcMessage.hpp"
    1718#include "CbcEventHandler.hpp"
     
    3536class CbcFeasibilityBase;
    3637class CbcStatistics;
     38class CbcFullNodeInfo;
    3739class CbcEventHandler ;
    3840class CglPreProcess;
    39 # ifdef COIN_HAS_CLP
    4041class OsiClpSolverInterface;
    4142class ClpNodeStuff;
    42 #endif
     43
    4344// #define CBC_CHECK_BASIS 1
    4445
     
    356357    /// Make given column cut into a global cut
    357358    void makeGlobalCut(const OsiColCut & cut);
     359    /// Make partial cut into a global cut and save
     360  void makePartialCut(const OsiRowCut * cut, const OsiSolverInterface * solver=NULL);
     361    /// Make partial cuts into global cuts
     362    void makeGlobalCuts();
     363    /// Which cut generator generated this cut
     364    inline const int * whichGenerator() const
     365    { return whichGenerator_;}
    358366    //@}
    359367
     
    434442    */
    435443    void AddIntegers();
    436 
    437444    /**
    438445      Save copy of the model.
    439446    */
    440447    void saveModel(OsiSolverInterface * saveSolver, double * checkCutoffForRestart, bool * feasible);
     448    /**
     449      Flip direction of optimization on all models
     450    */
     451    void flipModel();
    441452
    442453    //@}
     
    705716        return getDblParam(CbcCutoffIncrement);
    706717    }
     718    /// See if can stop on gap
     719    bool canStopOnGap() const;
    707720
    708721    /** Pass in target solution and optional priorities.
     
    804817        return numberPenalties_;
    805818    }
     819    /// Pointer to top of tree
     820    inline const CbcFullNodeInfo * topOfTree() const
     821    { return topOfTree_;}
    806822    /// Number of analyze iterations to do
    807823    inline void setNumberAnalyzeIterations(int number) {
     
    848864    }
    849865    /// Set original columns as created by preprocessing
    850     void setOriginalColumns(const int * originalColumns) ;
     866    void setOriginalColumns(const int * originalColumns,
     867                            int numberGood=COIN_INT_MAX) ;
     868    /// Create conflict cut (well - most of)
     869    OsiRowCut * conflictCut(const OsiSolverInterface * solver, bool & localCuts);
    851870
    852871    /** Set the print frequency.
     
    930949        6 stopped on solutions
    931950        7 linear relaxation unbounded
     951        8 stopped on iteration limit
    932952    */
    933953    inline int secondaryStatus() const {
     
    13051325    /// Return a saved solution objective (0==best) - COIN_DBL_MAX if off end
    13061326    double savedSolutionObjective(int which) const;
     1327    /// Delete a saved solution and move others up
     1328    void deleteSavedSolution(int which);
    13071329
    13081330    /** Current phase (so heuristics etc etc can find out).
     
    13861408        stopNumberIterations_ = value;
    13871409    }
     1410    /// A pointer to model from CbcHeuristic
     1411    inline CbcModel * heuristicModel() const
     1412    { return heuristicModel_;}
     1413    /// Set a pointer to model from CbcHeuristic
     1414    inline void setHeuristicModel(CbcModel * model)
     1415    { heuristicModel_ = model;}
    13881416    //@}
    13891417
     
    15051533    inline void setSearchStrategy(int value) {
    15061534        searchStrategy_ = value;
     1535    }
     1536    /// Stong branching strategy
     1537    inline int strongStrategy() const {
     1538        return strongStrategy_;
     1539    }
     1540    /// Set strong branching strategy
     1541    inline void setStrongStrategy(int value) {
     1542        strongStrategy_ = value;
    15071543    }
    15081544
     
    15791615    inline int numberHeuristics() const {
    15801616        return numberHeuristics_;
     1617    }
     1618    /// Set the number of heuristics
     1619    inline void setNumberHeuristics(int value) {
     1620        numberHeuristics_ = value;
    15811621    }
    15821622    /// Pointer to heuristic solver which found last solution (or NULL)
     
    16951735    inline void setDefaultHandler(bool yesNo) {
    16961736        defaultHandler_ = yesNo;
     1737    }
     1738    /// Check default handler
     1739    inline bool defaultHandler() const {
     1740        return defaultHandler_;
    16971741    }
    16981742    //@}
     
    17241768        19 bit (524288) - recipient CbcModel
    17251769        20 bit (1048576) - waiting for sub model to return
     1770        22 bit (4194304) - do not initialize random seed in solver (user has)
     1771        23 bit (8388608) - leave solver_ with cuts
    17261772    */
    17271773    inline void setSpecialOptions(int value) {
     
    17311777    inline int specialOptions() const {
    17321778        return specialOptions_;
     1779    }
     1780    /// Set random seed
     1781    inline void setRandomSeed(int value) {
     1782        randomSeed_ = value;
     1783    }
     1784    /// Get random seed
     1785    inline int getRandomSeed() const {
     1786        return randomSeed_;
     1787    }
     1788    /// Set multiple root tries
     1789    inline void setMultipleRootTries(int value) {
     1790        multipleRootTries_ = value;
     1791    }
     1792    /// Get multiple root tries
     1793    inline int getMultipleRootTries() const {
     1794        return multipleRootTries_;
    17331795    }
    17341796    /// Tell model to stop on event
     
    17591821        20 bit (1048576) - Reduce sum of infeasibilities before cuts
    17601822        21 bit (2097152) - Reduce sum of infeasibilities after cuts
     1823        22 bit (4194304) - Conflict analysis
     1824        23 bit (8388608) - Conflict analysis - temporary bit
     1825        24 bit (16777216) - Add cutoff as LP constraint (out)
     1826        25 bit (33554432) - diving/reordering
     1827        26 bit (67108864) - load global cuts from file
     1828        27 bit (134217728) - append binding global cuts to file
     1829        28 bit (268435456) - idiot branching
     1830        29 bit (536870912) - don't make fake objective
    17611831    */
    17621832    inline void setMoreSpecialOptions(int value) {
     
    17671837        return moreSpecialOptions_;
    17681838    }
    1769   /// Set time method
     1839    /// Set cutoff as constraint
     1840    inline void setCutoffAsConstraint(bool yesNo) {
     1841      cutoffRowNumber_ = (yesNo) ? -2 : -1;
     1842    }
     1843    /// Set time method
    17701844    inline void setUseElapsedTime(bool yesNo) {
    17711845        if (yesNo)
     
    17781852        return (moreSpecialOptions_&131072)!=0;
    17791853    }
     1854    /// Get useful temporary pointer
     1855    inline void * temporaryPointer() const
     1856    { return temporaryPointer_;}
     1857    /// Set useful temporary pointer
     1858    inline void setTemporaryPointer(void * pointer)
     1859    { temporaryPointer_=pointer;}
    17801860    /// Go to dantzig pivot selection if easy problem (clp only)
    1781 #ifdef COIN_HAS_CLP
    17821861    void goToDantzig(int numberNodes, ClpDualRowPivot *& savePivotMethod);
    1783 #endif
    17841862    /// Now we may not own objects - just point to solver's objects
    17851863    inline bool ownObjects() const {
     
    21582236    }
    21592237    /// Global cuts
    2160     inline OsiCuts * globalCuts() {
     2238    inline CbcRowCuts * globalCuts() {
    21612239        return &globalCuts_;
    21622240    }
     
    21912269        maximumNumberIterations_ = value;
    21922270    }
    2193 # ifdef COIN_HAS_CLP
    21942271    /// Set depth for fast nodes
    21952272    inline void setFastNodeDepth(int value) {
     
    22122289        numberExtraIterations_ += iterations;
    22132290    }
    2214 #endif
    22152291    /// Number of extra iterations
    22162292    inline int numberExtraIterations() const {
     
    23402416    CoinWarmStartBasis bestSolutionBasis_ ;
    23412417    /// Global cuts
    2342     OsiCuts globalCuts_;
     2418    CbcRowCuts globalCuts_;
     2419    /// Global conflict cuts
     2420    CbcRowCuts * globalConflictCuts_;
    23432421
    23442422    /// Minimum degradation in objective value to continue cut generation
     
    23922470    /// Number of rows at continuous
    23932471    int numberRowsAtContinuous_;
     2472    /**
     2473       -1 - cutoff as constraint not activated
     2474       -2 - waiting to activate
     2475       >=0 - activated
     2476     */
     2477    int cutoffRowNumber_;
    23942478    /// Maximum number of cuts
    23952479    int maximumNumberCuts_;
     
    24952579    /// Tree
    24962580    CbcTree * tree_;
     2581    /// Pointer to top of tree
     2582    CbcFullNodeInfo * topOfTree_;
    24972583    /// A pointer to model to be used for subtrees
    24982584    CbcModel * subTreeModel_;
     2585    /// A pointer to model from CbcHeuristic
     2586    CbcModel * heuristicModel_;
    24992587    /// Number of times any subtree stopped on nodes, time etc
    25002588    int numberStoppedSubTrees_;
     
    25552643    /// Arrays with analysis results
    25562644    double * analyzeResults_;
     2645    /// Useful temporary pointer
     2646    void * temporaryPointer_;
    25572647    /// Number of nodes infeasible by normal branching (before cuts)
    25582648    int numberInfeasibleNodes_;
     
    26362726    /// Maximum number of rows
    26372727    int maximumRows_;
     2728    /// Random seed
     2729    int randomSeed_;
     2730    /// Multiple root tries
     2731    int multipleRootTries_;
    26382732    /// Current depth
    26392733    int currentDepth_;
     
    26702764    /// Strategy worked out - mainly at root node
    26712765    int searchStrategy_;
     2766    /** Strategy for strong branching
     2767        0 - normal
     2768        when to do all fractional
     2769        1 - root node
     2770        2 - depth less than modifier
     2771        4 - if objective == best possible
     2772        6 - as 2+4
     2773        when to do all including satisfied
     2774        10 - root node etc.
     2775        If >=100 then do when depth <= strategy/100 (otherwise 5)
     2776     */
     2777    int strongStrategy_;
    26722778    /// Number of iterations in strong branching
    26732779    int numberStrongIterations_;
Note: See TracChangeset for help on using the changeset viewer.