source: trunk/Cbc/src/CbcModel.hpp @ 1813

Last change on this file since 1813 was 1813, checked in by forrest, 7 years ago

add random seed setting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 98.2 KB
Line 
1/* $Id: CbcModel.hpp 1813 2012-11-22 19:00:22Z forrest $ */
2// Copyright (C) 2002, International Business Machines
3// Corporation and others.  All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5
6#ifndef CbcModel_H
7#define CbcModel_H
8#include <string>
9#include <vector>
10#include "CoinMessageHandler.hpp"
11#include "OsiSolverInterface.hpp"
12#include "OsiBranchingObject.hpp"
13#include "OsiCuts.hpp"
14#include "CoinWarmStartBasis.hpp"
15#include "CbcCompareBase.hpp"
16#include "CbcMessage.hpp"
17#include "CbcEventHandler.hpp"
18#include "ClpDualRowPivot.hpp"
19
20
21class CbcCutGenerator;
22class CbcBaseModel;
23class OsiRowCut;
24class OsiBabSolver;
25class OsiRowCutDebugger;
26class CglCutGenerator;
27class CglStored;
28class CbcCutModifier;
29class CglTreeProbingInfo;
30class CbcHeuristic;
31class OsiObject;
32class CbcThread;
33class CbcTree;
34class CbcStrategy;
35class CbcFeasibilityBase;
36class CbcStatistics;
37class CbcEventHandler ;
38class CglPreProcess;
39# ifdef COIN_HAS_CLP
40class OsiClpSolverInterface;
41class ClpNodeStuff;
42#endif
43// #define CBC_CHECK_BASIS 1
44
45//#############################################################################
46
47/** Simple Branch and bound class
48
49  The initialSolve() method solves the initial LP relaxation of the MIP
50  problem. The branchAndBound() method can then be called to finish using
51  a branch and cut algorithm.
52
53  <h3>Search Tree Traversal</h3>
54
55  Subproblems (aka nodes) requiring additional evaluation are stored using
56  the CbcNode and CbcNodeInfo objects. Ancestry linkage is maintained in the
57  CbcNodeInfo object. Evaluation of a subproblem within branchAndBound()
58  proceeds as follows:
59  <ul>
60    <li> The node representing the most promising parent subproblem is popped
61         from the heap which holds the set of subproblems requiring further
62         evaluation.
63    <li> Using branching instructions stored in the node, and information in
64         its ancestors, the model and solver are adjusted to create the
65         active subproblem.
66    <li> If the parent subproblem will require further evaluation
67         (<i>i.e.</i>, there are branches remaining) its node is pushed back
68         on the heap. Otherwise, the node is deleted.  This may trigger
69         recursive deletion of ancestors.
70    <li> The newly created subproblem is evaluated.
71    <li> If the subproblem requires further evaluation, a node is created.
72         All information needed to recreate the subproblem (branching
73         information, row and column cuts) is placed in the node and the node
74         is added to the set of subproblems awaiting further evaluation.
75  </ul>
76  Note that there is never a node representing the active subproblem; the model
77  and solver represent the active subproblem.
78
79  <h3>Row (Constraint) Cut Handling</h3>
80
81  For a typical subproblem, the sequence of events is as follows:
82  <ul>
83    <li> The subproblem is rebuilt for further evaluation: One result of a
84         call to addCuts() is a traversal of ancestors, leaving a list of all
85         cuts used in the ancestors in #addedCuts_. This list is then scanned
86         to construct a basis that includes only tight cuts. Entries for
87         loose cuts are set to NULL.
88    <li> The subproblem is evaluated: One result of a call to solveWithCuts()
89         is the return of a set of newly generated cuts for the subproblem.
90         #addedCuts_ is also kept up-to-date as old cuts become loose.
91    <li> The subproblem is stored for further processing: A call to
92         CbcNodeInfo::addCuts() adds the newly generated cuts to the
93         CbcNodeInfo object associated with this node.
94  </ul>
95  See CbcCountRowCut for details of the bookkeeping associated with cut
96  management.
97*/
98
99class CbcModel  {
100
101public:
102
103    enum CbcIntParam {
104        /** The maximum number of nodes before terminating */
105        CbcMaxNumNode = 0,
106        /** The maximum number of solutions before terminating */
107        CbcMaxNumSol,
108        /** Fathoming discipline
109
110          Controls objective function comparisons for purposes of fathoming by bound
111          or determining monotonic variables.
112
113          If 1, action is taken only when the current objective is strictly worse
114          than the target. Implementation is handled by adding a small tolerance to
115          the target.
116        */
117        CbcFathomDiscipline,
118        /** Adjusts printout
119            1 does different node message with number unsatisfied on last branch
120        */
121        CbcPrinting,
122        /** Number of branches (may be more than number of nodes as may
123            include strong branching) */
124        CbcNumberBranches,
125        /** Just a marker, so that a static sized array can store parameters. */
126        CbcLastIntParam
127    };
128
129    enum CbcDblParam {
130        /** The maximum amount the value of an integer variable can vary from
131            integer and still be considered feasible. */
132        CbcIntegerTolerance = 0,
133        /** The objective is assumed to worsen by this amount for each
134            integer infeasibility. */
135        CbcInfeasibilityWeight,
136        /** The amount by which to tighten the objective function cutoff when
137            a new solution is discovered. */
138        CbcCutoffIncrement,
139        /** Stop when the gap between the objective value of the best known solution
140          and the best bound on the objective of any solution is less than this.
141
142          This is an absolute value. Conversion from a percentage is left to the
143          client.
144        */
145        CbcAllowableGap,
146        /** Stop when the gap between the objective value of the best known solution
147          and the best bound on the objective of any solution is less than this
148          fraction of of the absolute value of best known solution.
149
150          Code stops if either this test or CbcAllowableGap test succeeds
151        */
152        CbcAllowableFractionGap,
153        /** \brief The maximum number of seconds before terminating.
154               A double should be adequate! */
155        CbcMaximumSeconds,
156        /// Cutoff - stored for speed
157        CbcCurrentCutoff,
158        /// Optimization direction - stored for speed
159        CbcOptimizationDirection,
160        /// Current objective value
161        CbcCurrentObjectiveValue,
162        /// Current minimization objective value
163        CbcCurrentMinimizationObjectiveValue,
164        /** \brief The time at start of model.
165               So that other pieces of code can access */
166        CbcStartSeconds,
167        /** Stop doing heuristics when the gap between the objective value of the
168            best known solution and the best bound on the objective of any solution
169            is less than this.
170
171          This is an absolute value. Conversion from a percentage is left to the
172          client.
173        */
174        CbcHeuristicGap,
175        /** Stop doing heuristics when the gap between the objective value of the
176            best known solution and the best bound on the objective of any solution
177            is less than this fraction of of the absolute value of best known
178            solution.
179
180          Code stops if either this test or CbcAllowableGap test succeeds
181        */
182        CbcHeuristicFractionGap,
183        /// Smallest non-zero change on a branch
184        CbcSmallestChange,
185        /// Sum of non-zero changes on a branch
186        CbcSumChange,
187        /// Largest non-zero change on a branch
188        CbcLargestChange,
189        /// Small non-zero change on a branch to be used as guess
190        CbcSmallChange,
191        /** Just a marker, so that a static sized array can store parameters. */
192        CbcLastDblParam
193    };
194
195    //---------------------------------------------------------------------------
196
197public:
198    ///@name Solve methods
199    //@{
200    /** \brief Solve the initial LP relaxation
201
202      Invoke the solver's %initialSolve() method.
203    */
204    void initialSolve();
205
206    /** \brief Invoke the branch \& cut algorithm
207
208      The method assumes that initialSolve() has been called to solve the
209      LP relaxation. It processes the root node, then proceeds to explore the
210      branch & cut search tree. The search ends when the tree is exhausted or
211      one of several execution limits is reached.
212      If doStatistics is 1 summary statistics are printed
213      if 2 then also the path to best solution (if found by branching)
214      if 3 then also one line per node
215    */
216    void branchAndBound(int doStatistics = 0);
217private:
218
219    /** \brief Evaluate a subproblem using cutting planes and heuristics
220
221      The method invokes a main loop which generates cuts, applies heuristics,
222      and reoptimises using the solver's native %resolve() method.
223      It returns true if the subproblem remains feasible at the end of the
224      evaluation.
225    */
226    bool solveWithCuts(OsiCuts & cuts, int numberTries, CbcNode * node);
227    /** Generate one round of cuts - serial mode
228      returns -
229      0 - normal
230      1 - must keep going
231      2 - set numberTries to zero
232      -1 - infeasible
233    */
234    int serialCuts(OsiCuts & cuts, CbcNode * node, OsiCuts & slackCuts, int lastNumberCuts);
235    /** Generate one round of cuts - parallel mode
236        returns -
237        0 - normal
238        1 - must keep going
239        2 - set numberTries to zero
240        -1 - infeasible
241    */
242    int parallelCuts(CbcBaseModel * master, OsiCuts & cuts, CbcNode * node, OsiCuts & slackCuts, int lastNumberCuts);
243    /** Input one node output N nodes to put on tree and optional solution update
244        This should be able to operate in parallel so is given a solver and is const(ish)
245        However we will need to keep an array of solver_ and bases and more
246        status is 0 for normal, 1 if solution
247        Calling code should always push nodes back on tree
248    */
249    CbcNode ** solveOneNode(int whichSolver, CbcNode * node,
250                            int & numberNodesOutput, int & status) ;
251    /// Update size of whichGenerator
252    void resizeWhichGenerator(int numberNow, int numberAfter);
253public:
254#ifdef CBC_KEEP_DEPRECATED
255    // See if anyone is using these any more!!
256    /** \brief create a clean model from partially fixed problem
257
258      The method creates a new model with given bounds and with no tree.
259    */
260    CbcModel *  cleanModel(const double * lower, const double * upper);
261    /** \brief Invoke the branch \& cut algorithm on partially fixed problem
262
263      The method presolves the given model and does branch and cut. The search
264      ends when the tree is exhausted or maximum nodes is reached.
265
266      If better solution found then it is saved.
267
268      Returns 0 if search completed and solution, 1 if not completed and solution,
269      2 if completed and no solution, 3 if not completed and no solution.
270
271      Normally okay to do cleanModel immediately followed by subBranchandBound
272      (== other form of subBranchAndBound)
273      but may need to get at model for advanced features.
274
275      Deletes model2
276    */
277    int subBranchAndBound(CbcModel * model2,
278                          CbcModel * presolvedModel,
279                          int maximumNodes);
280    /** \brief Invoke the branch \& cut algorithm on partially fixed problem
281
282      The method creates a new model with given bounds, presolves it
283      then proceeds to explore the branch & cut search tree. The search
284      ends when the tree is exhausted or maximum nodes is reached.
285
286      If better solution found then it is saved.
287
288      Returns 0 if search completed and solution, 1 if not completed and solution,
289      2 if completed and no solution, 3 if not completed and no solution.
290
291      This is just subModel immediately followed by other version of
292      subBranchandBound.
293
294    */
295    int subBranchAndBound(const double * lower, const double * upper,
296                          int maximumNodes);
297
298    /** \brief Process root node and return a strengthened model
299
300      The method assumes that initialSolve() has been called to solve the
301      LP relaxation. It processes the root node and then returns a pointer
302      to the strengthened model (or NULL if infeasible)
303    */
304    OsiSolverInterface *  strengthenedModel();
305    /** preProcess problem - replacing solver
306        If makeEquality true then <= cliques converted to ==.
307        Presolve will be done numberPasses times.
308
309        Returns NULL if infeasible
310
311        If makeEquality is 1 add slacks to get cliques,
312        if 2 add slacks to get sos (but only if looks plausible) and keep sos info
313    */
314    CglPreProcess * preProcess( int makeEquality = 0, int numberPasses = 5,
315                                int tuning = 5);
316    /** Does postprocessing - original solver back.
317        User has to delete process */
318    void postProcess(CglPreProcess * process);
319#endif
320    /// Adds an update information object
321    void addUpdateInformation(const CbcObjectUpdateData & data);
322    /** Do one node - broken out for clarity?
323        also for parallel (when baseModel!=this)
324        Returns 1 if solution found
325        node NULL on return if no branches left
326        newNode NULL if no new node created
327    */
328    int doOneNode(CbcModel * baseModel, CbcNode * & node, CbcNode * & newNode);
329
330public:
331    /** \brief Reoptimise an LP relaxation
332
333      Invoke the solver's %resolve() method.
334      whereFrom -
335      0 - initial continuous
336      1 - resolve on branch (before new cuts)
337      2 - after new cuts
338      3  - obsolete code or something modified problem in unexpected way
339      10 - after strong branching has fixed variables at root
340      11 - after strong branching has fixed variables in tree
341
342      returns 1 feasible, 0 infeasible, -1 feasible but skip cuts
343    */
344    int resolve(CbcNodeInfo * parent, int whereFrom,
345                double * saveSolution = NULL,
346                double * saveLower = NULL,
347                double * saveUpper = NULL);
348    /// Make given rows (L or G) into global cuts and remove from lp
349    void makeGlobalCuts(int numberRows, const int * which);
350    /// Make given cut into a global cut
351    void makeGlobalCut(const OsiRowCut * cut);
352    /// Make given cut into a global cut
353    void makeGlobalCut(const OsiRowCut & cut);
354    /// Make given column cut into a global cut
355    void makeGlobalCut(const OsiColCut * cut);
356    /// Make given column cut into a global cut
357    void makeGlobalCut(const OsiColCut & cut);
358    //@}
359
360    /** \name Presolve methods */
361    //@{
362
363    /** Identify cliques and construct corresponding objects.
364
365        Find cliques with size in the range
366        [\p atLeastThisMany, \p lessThanThis] and construct corresponding
367        CbcClique objects.
368        If \p makeEquality is true then a new model may be returned if
369        modifications had to be made, otherwise \c this is returned.
370        If the problem is infeasible #numberObjects_ is set to -1.
371        A client must use deleteObjects() before a second call to findCliques().
372        If priorities exist, clique priority is set to the default.
373    */
374    CbcModel * findCliques(bool makeEquality, int atLeastThisMany,
375                           int lessThanThis, int defaultValue = 1000);
376
377    /** Do integer presolve, creating a new (presolved) model.
378
379      Returns the new model, or NULL if feasibility is lost.
380      If weak is true then just does a normal presolve
381
382      \todo It remains to work out the cleanest way of getting a solution to
383            the original problem at the end. So this is very preliminary.
384     */
385    CbcModel * integerPresolve(bool weak = false);
386
387    /** Do integer presolve, modifying the current model.
388
389        Returns true if the model remains feasible after presolve.
390    */
391    bool integerPresolveThisModel(OsiSolverInterface * originalSolver, bool weak = false);
392
393
394    /// Put back information into the original model after integer presolve.
395    void originalModel(CbcModel * presolvedModel, bool weak);
396
397    /** \brief For variables involved in VUB constraints, see if we can tighten
398           bounds by solving lp's
399
400        Returns false if feasibility is lost.
401        If CglProbing is available, it will be tried as well to see if it can
402        tighten bounds.
403        This routine is just a front end for tightenVubs(int,const int*,double).
404
405        If <tt>type = -1</tt> all variables are processed (could be very slow).
406        If <tt>type = 0</tt> only variables involved in VUBs are processed.
407        If <tt>type = n > 0</tt>, only the n most expensive VUB variables
408        are processed, where it is assumed that x is at its maximum so delta
409        would have to go to 1 (if x not at bound).
410
411        If \p allowMultipleBinary is true, then a VUB constraint is a row with
412        one continuous variable and any number of binary variables.
413
414        If <tt>useCutoff < 1.0e30</tt>, the original objective is installed as a
415        constraint with \p useCutoff as a bound.
416    */
417    bool tightenVubs(int type, bool allowMultipleBinary = false,
418                     double useCutoff = 1.0e50);
419
420    /** \brief For variables involved in VUB constraints, see if we can tighten
421           bounds by solving lp's
422
423      This version is just handed a list of variables to be processed.
424    */
425    bool tightenVubs(int numberVubs, const int * which,
426                     double useCutoff = 1.0e50);
427    /**
428      Analyze problem to find a minimum change in the objective function.
429    */
430    void analyzeObjective();
431
432    /**
433      Add additional integers.
434    */
435    void AddIntegers();
436
437    /**
438      Save copy of the model.
439    */
440    void saveModel(OsiSolverInterface * saveSolver, double * checkCutoffForRestart, bool * feasible);
441    /**
442      Flip direction of optimization on all models
443    */
444    void flipModel();
445
446    //@}
447
448    /** \name Object manipulation routines
449
450      See OsiObject for an explanation of `object' in the context of CbcModel.
451    */
452    //@{
453
454    /// Get the number of objects
455    inline int numberObjects() const {
456        return numberObjects_;
457    }
458    /// Set the number of objects
459    inline void setNumberObjects(int number) {
460        numberObjects_ = number;
461    }
462
463    /// Get the array of objects
464    inline OsiObject ** objects() const {
465        return object_;
466    }
467
468    /// Get the specified object
469    const inline OsiObject * object(int which) const {
470        return object_[which];
471    }
472    /// Get the specified object
473    inline OsiObject * modifiableObject(int which) const {
474        return object_[which];
475    }
476
477    void setOptionalInteger(int index);
478
479    /// Delete all object information (and just back to integers if true)
480    void deleteObjects(bool findIntegers = true);
481
482    /** Add in object information.
483
484      Objects are cloned; the owner can delete the originals.
485    */
486    void addObjects(int numberObjects, OsiObject ** objects);
487
488    /** Add in object information.
489
490      Objects are cloned; the owner can delete the originals.
491    */
492    void addObjects(int numberObjects, CbcObject ** objects);
493
494    /// Ensure attached objects point to this model.
495    void synchronizeModel() ;
496
497    /** \brief Identify integer variables and create corresponding objects.
498
499      Record integer variables and create an CbcSimpleInteger object for each
500      one.
501      If \p startAgain is true, a new scan is forced, overwriting any existing
502      integer variable information.
503      If type > 0 then 1==PseudoCost, 2 new ones low priority
504    */
505
506    void findIntegers(bool startAgain, int type = 0);
507
508    //@}
509
510    //---------------------------------------------------------------------------
511
512    /**@name Parameter set/get methods
513
514       The set methods return true if the parameter was set to the given value,
515       false if the value of the parameter is out of range.
516
517       The get methods return the value of the parameter.
518
519    */
520    //@{
521    /// Set an integer parameter
522    inline bool setIntParam(CbcIntParam key, int value) {
523        intParam_[key] = value;
524        return true;
525    }
526    /// Set a double parameter
527    inline bool setDblParam(CbcDblParam key, double value) {
528        dblParam_[key] = value;
529        return true;
530    }
531    /// Get an integer parameter
532    inline int getIntParam(CbcIntParam key) const {
533        return intParam_[key];
534    }
535    /// Get a double parameter
536    inline double getDblParam(CbcDblParam key) const {
537        return dblParam_[key];
538    }
539    /*! \brief Set cutoff bound on the objective function.
540
541      When using strict comparison, the bound is adjusted by a tolerance to
542      avoid accidentally cutting off the optimal solution.
543    */
544    void setCutoff(double value) ;
545
546    /// Get the cutoff bound on the objective function - always as minimize
547    inline double getCutoff() const { //double value ;
548        //solver_->getDblParam(OsiDualObjectiveLimit,value) ;
549        //assert( dblParam_[CbcCurrentCutoff]== value * solver_->getObjSense());
550        return dblParam_[CbcCurrentCutoff];
551    }
552
553    /// Set the \link CbcModel::CbcMaxNumNode maximum node limit \endlink
554    inline bool setMaximumNodes( int value) {
555        return setIntParam(CbcMaxNumNode, value);
556    }
557
558    /// Get the \link CbcModel::CbcMaxNumNode maximum node limit \endlink
559    inline int getMaximumNodes() const {
560        return getIntParam(CbcMaxNumNode);
561    }
562
563    /** Set the
564        \link CbcModel::CbcMaxNumSol maximum number of solutions \endlink
565        desired.
566    */
567    inline bool setMaximumSolutions( int value) {
568        return setIntParam(CbcMaxNumSol, value);
569    }
570    /** Get the
571        \link CbcModel::CbcMaxNumSol maximum number of solutions \endlink
572        desired.
573    */
574    inline int getMaximumSolutions() const {
575        return getIntParam(CbcMaxNumSol);
576    }
577    /// Set the printing mode
578    inline bool setPrintingMode( int value) {
579        return setIntParam(CbcPrinting, value);
580    }
581
582    /// Get the printing mode
583    inline int getPrintingMode() const {
584        return getIntParam(CbcPrinting);
585    }
586
587    /** Set the
588        \link CbcModel::CbcMaximumSeconds maximum number of seconds \endlink
589        desired.
590    */
591    inline bool setMaximumSeconds( double value) {
592        return setDblParam(CbcMaximumSeconds, value);
593    }
594    /** Get the
595        \link CbcModel::CbcMaximumSeconds maximum number of seconds \endlink
596        desired.
597    */
598    inline double getMaximumSeconds() const {
599        return getDblParam(CbcMaximumSeconds);
600    }
601    /// Current time since start of branchAndbound
602    double getCurrentSeconds() const ;
603
604    /// Return true if maximum time reached
605    bool maximumSecondsReached() const ;
606
607    /** Set the
608      \link CbcModel::CbcIntegerTolerance integrality tolerance \endlink
609    */
610    inline bool setIntegerTolerance( double value) {
611        return setDblParam(CbcIntegerTolerance, value);
612    }
613    /** Get the
614      \link CbcModel::CbcIntegerTolerance integrality tolerance \endlink
615    */
616    inline double getIntegerTolerance() const {
617        return getDblParam(CbcIntegerTolerance);
618    }
619
620    /** Set the
621        \link CbcModel::CbcInfeasibilityWeight
622          weight per integer infeasibility \endlink
623    */
624    inline bool setInfeasibilityWeight( double value) {
625        return setDblParam(CbcInfeasibilityWeight, value);
626    }
627    /** Get the
628        \link CbcModel::CbcInfeasibilityWeight
629          weight per integer infeasibility \endlink
630    */
631    inline double getInfeasibilityWeight() const {
632        return getDblParam(CbcInfeasibilityWeight);
633    }
634
635    /** Set the \link CbcModel::CbcAllowableGap allowable gap \endlink
636        between the best known solution and the best possible solution.
637    */
638    inline bool setAllowableGap( double value) {
639        return setDblParam(CbcAllowableGap, value);
640    }
641    /** Get the \link CbcModel::CbcAllowableGap allowable gap \endlink
642        between the best known solution and the best possible solution.
643    */
644    inline double getAllowableGap() const {
645        return getDblParam(CbcAllowableGap);
646    }
647
648    /** Set the \link CbcModel::CbcAllowableFractionGap fraction allowable gap \endlink
649        between the best known solution and the best possible solution.
650    */
651    inline bool setAllowableFractionGap( double value) {
652        return setDblParam(CbcAllowableFractionGap, value);
653    }
654    /** Get the \link CbcModel::CbcAllowableFractionGap fraction allowable gap \endlink
655        between the best known solution and the best possible solution.
656    */
657    inline double getAllowableFractionGap() const {
658        return getDblParam(CbcAllowableFractionGap);
659    }
660    /** Set the \link CbcModel::CbcAllowableFractionGap percentage allowable gap \endlink
661        between the best known solution and the best possible solution.
662    */
663    inline bool setAllowablePercentageGap( double value) {
664        return setDblParam(CbcAllowableFractionGap, value*0.01);
665    }
666    /** Get the \link CbcModel::CbcAllowableFractionGap percentage allowable gap \endlink
667        between the best known solution and the best possible solution.
668    */
669    inline double getAllowablePercentageGap() const {
670        return 100.0*getDblParam(CbcAllowableFractionGap);
671    }
672    /** Set the \link CbcModel::CbcHeuristicGap heuristic gap \endlink
673        between the best known solution and the best possible solution.
674    */
675    inline bool setHeuristicGap( double value) {
676        return setDblParam(CbcHeuristicGap, value);
677    }
678    /** Get the \link CbcModel::CbcHeuristicGap heuristic gap \endlink
679        between the best known solution and the best possible solution.
680    */
681    inline double getHeuristicGap() const {
682        return getDblParam(CbcHeuristicGap);
683    }
684
685    /** Set the \link CbcModel::CbcHeuristicFractionGap fraction heuristic gap \endlink
686        between the best known solution and the best possible solution.
687    */
688    inline bool setHeuristicFractionGap( double value) {
689        return setDblParam(CbcHeuristicFractionGap, value);
690    }
691    /** Get the \link CbcModel::CbcHeuristicFractionGap fraction heuristic gap \endlink
692        between the best known solution and the best possible solution.
693    */
694    inline double getHeuristicFractionGap() const {
695        return getDblParam(CbcHeuristicFractionGap);
696    }
697    /** Set the
698        \link CbcModel::CbcCutoffIncrement  \endlink
699        desired.
700    */
701    inline bool setCutoffIncrement( double value) {
702        return setDblParam(CbcCutoffIncrement, value);
703    }
704    /** Get the
705        \link CbcModel::CbcCutoffIncrement  \endlink
706        desired.
707    */
708    inline double getCutoffIncrement() const {
709        return getDblParam(CbcCutoffIncrement);
710    }
711    /// See if can stop on gap
712    bool canStopOnGap() const;
713
714    /** Pass in target solution and optional priorities.
715        If priorities then >0 means only branch if incorrect
716        while <0 means branch even if correct. +1 or -1 are
717        highest priority */
718    void setHotstartSolution(const double * solution, const int * priorities = NULL) ;
719
720    /// Set the minimum drop to continue cuts
721    inline void setMinimumDrop(double value) {
722        minimumDrop_ = value;
723    }
724    /// Get the minimum drop to continue cuts
725    inline double getMinimumDrop() const {
726        return minimumDrop_;
727    }
728
729    /** Set the maximum number of cut passes at root node (default 20)
730        Minimum drop can also be used for fine tuning */
731    inline void setMaximumCutPassesAtRoot(int value) {
732        maximumCutPassesAtRoot_ = value;
733    }
734    /** Get the maximum number of cut passes at root node */
735    inline int getMaximumCutPassesAtRoot() const {
736        return maximumCutPassesAtRoot_;
737    }
738
739    /** Set the maximum number of cut passes at other nodes (default 10)
740        Minimum drop can also be used for fine tuning */
741    inline void setMaximumCutPasses(int value) {
742        maximumCutPasses_ = value;
743    }
744    /** Get the maximum number of cut passes at other nodes (default 10) */
745    inline int getMaximumCutPasses() const {
746        return maximumCutPasses_;
747    }
748    /** Get current cut pass number in this round of cuts.
749        (1 is first pass) */
750    inline int getCurrentPassNumber() const {
751        return currentPassNumber_;
752    }
753
754    /** Set the maximum number of candidates to be evaluated for strong
755      branching.
756
757      A value of 0 disables strong branching.
758    */
759    void setNumberStrong(int number);
760    /** Get the maximum number of candidates to be evaluated for strong
761      branching.
762    */
763    inline int numberStrong() const {
764        return numberStrong_;
765    }
766    /** Set global preferred way to branch
767        -1 down, +1 up, 0 no preference */
768    inline void setPreferredWay(int value) {
769        preferredWay_ = value;
770    }
771    /** Get the preferred way to branch (default 0) */
772    inline int getPreferredWay() const {
773        return preferredWay_;
774    }
775    /// Get at which depths to do cuts
776    inline int whenCuts() const {
777        return whenCuts_;
778    }
779    /// Set at which depths to do cuts
780    inline void setWhenCuts(int value) {
781        whenCuts_ = value;
782    }
783    /** Return true if we want to do cuts
784        If allowForTopOfTree zero then just does on multiples of depth
785        if 1 then allows for doing at top of tree
786        if 2 then says if cuts allowed anywhere apart from root
787    */
788    bool doCutsNow(int allowForTopOfTree) const;
789
790    /** Set the number of branches before pseudo costs believed
791        in dynamic strong branching.
792
793      A value of 0 disables dynamic strong branching.
794    */
795    void setNumberBeforeTrust(int number);
796    /** get the number of branches before pseudo costs believed
797        in dynamic strong branching. */
798    inline int numberBeforeTrust() const {
799        return numberBeforeTrust_;
800    }
801    /** Set the number of variables for which to compute penalties
802        in dynamic strong branching.
803
804      A value of 0 disables penalties.
805    */
806    void setNumberPenalties(int number);
807    /** get the number of variables for which to compute penalties
808        in dynamic strong branching. */
809    inline int numberPenalties() const {
810        return numberPenalties_;
811    }
812    /// Number of analyze iterations to do
813    inline void setNumberAnalyzeIterations(int number) {
814        numberAnalyzeIterations_ = number;
815    }
816    inline int numberAnalyzeIterations() const {
817        return numberAnalyzeIterations_;
818    }
819    /** Get scale factor to make penalties match strong.
820        Should/will be computed */
821    inline double penaltyScaleFactor() const {
822        return penaltyScaleFactor_;
823    }
824    /** Set scale factor to make penalties match strong.
825        Should/will be computed */
826    void setPenaltyScaleFactor(double value);
827    /** Problem type as set by user or found by analysis.  This will be extended
828        0 - not known
829        1 - Set partitioning <=
830        2 - Set partitioning ==
831        3 - Set covering
832        4 - all +- 1 or all +1 and odd
833    */
834    void inline setProblemType(int number) {
835        problemType_ = number;
836    }
837    inline int problemType() const {
838        return problemType_;
839    }
840    /// Current depth
841    inline int currentDepth() const {
842        return currentDepth_;
843    }
844
845    /// Set how often to scan global cuts
846    void setHowOftenGlobalScan(int number);
847    /// Get how often to scan global cuts
848    inline int howOftenGlobalScan() const {
849        return howOftenGlobalScan_;
850    }
851    /// Original columns as created by integerPresolve or preprocessing
852    inline int * originalColumns() const {
853        return originalColumns_;
854    }
855    /// Set original columns as created by preprocessing
856    void setOriginalColumns(const int * originalColumns) ;
857
858    /** Set the print frequency.
859
860      Controls the number of nodes evaluated between status prints.
861      If <tt>number <=0</tt> the print frequency is set to 100 nodes for large
862      problems, 1000 for small problems.
863      Print frequency has very slight overhead if small.
864    */
865    inline void setPrintFrequency(int number) {
866        printFrequency_ = number;
867    }
868    /// Get the print frequency
869    inline int printFrequency() const {
870        return printFrequency_;
871    }
872    //@}
873
874    //---------------------------------------------------------------------------
875    ///@name Methods returning info on how the solution process terminated
876    //@{
877    /// Are there a numerical difficulties?
878    bool isAbandoned() const;
879    /// Is optimality proven?
880    bool isProvenOptimal() const;
881    /// Is  infeasiblity proven (or none better than cutoff)?
882    bool isProvenInfeasible() const;
883    /// Was continuous solution unbounded
884    bool isContinuousUnbounded() const;
885    /// Was continuous solution unbounded
886    bool isProvenDualInfeasible() const;
887    /// Node limit reached?
888    bool isNodeLimitReached() const;
889    /// Time limit reached?
890    bool isSecondsLimitReached() const;
891    /// Solution limit reached?
892    bool isSolutionLimitReached() const;
893    /// Get how many iterations it took to solve the problem.
894    inline int getIterationCount() const {
895        return numberIterations_;
896    }
897    /// Increment how many iterations it took to solve the problem.
898    inline void incrementIterationCount(int value) {
899        numberIterations_ += value;
900    }
901    /// Get how many Nodes it took to solve the problem (including those in complete fathoming B&B inside CLP).
902    inline int getNodeCount() const {
903        return numberNodes_;
904    }
905    /// Increment how many nodes it took to solve the problem.
906    inline void incrementNodeCount(int value) {
907        numberNodes_ += value;
908    }
909    /// Get how many Nodes were enumerated in complete fathoming B&B inside CLP
910    inline int getExtraNodeCount() const {
911       return numberExtraNodes_;
912    }
913    /** Final status of problem
914        Some of these can be found out by is...... functions
915        -1 before branchAndBound
916        0 finished - check isProvenOptimal or isProvenInfeasible to see if solution found
917        (or check value of best solution)
918        1 stopped - on maxnodes, maxsols, maxtime
919        2 difficulties so run was abandoned
920        (5 event user programmed event occurred)
921    */
922    inline int status() const {
923        return status_;
924    }
925    inline void setProblemStatus(int value) {
926        status_ = value;
927    }
928    /** Secondary status of problem
929        -1 unset (status_ will also be -1)
930        0 search completed with solution
931        1 linear relaxation not feasible (or worse than cutoff)
932        2 stopped on gap
933        3 stopped on nodes
934        4 stopped on time
935        5 stopped on user event
936        6 stopped on solutions
937        7 linear relaxation unbounded
938        8 stopped on iteration limit
939    */
940    inline int secondaryStatus() const {
941        return secondaryStatus_;
942    }
943    inline void setSecondaryStatus(int value) {
944        secondaryStatus_ = value;
945    }
946    /// Are there numerical difficulties (for initialSolve) ?
947    bool isInitialSolveAbandoned() const ;
948    /// Is optimality proven (for initialSolve) ?
949    bool isInitialSolveProvenOptimal() const ;
950    /// Is primal infeasiblity proven (for initialSolve) ?
951    bool isInitialSolveProvenPrimalInfeasible() const ;
952    /// Is dual infeasiblity proven (for initialSolve) ?
953    bool isInitialSolveProvenDualInfeasible() const ;
954
955    //@}
956
957    //---------------------------------------------------------------------------
958    /**@name Problem information methods
959
960       These methods call the solver's query routines to return
961       information about the problem referred to by the current object.
962       Querying a problem that has no data associated with it result in
963       zeros for the number of rows and columns, and NULL pointers from
964       the methods that return vectors.
965
966       Const pointers returned from any data-query method are valid as
967       long as the data is unchanged and the solver is not called.
968    */
969    //@{
970    /// Number of rows in continuous (root) problem.
971    inline int numberRowsAtContinuous() const {
972        return numberRowsAtContinuous_;
973    }
974
975    /// Get number of columns
976    inline int getNumCols() const {
977        return solver_->getNumCols();
978    }
979
980    /// Get number of rows
981    inline int getNumRows() const {
982        return solver_->getNumRows();
983    }
984
985    /// Get number of nonzero elements
986    inline CoinBigIndex getNumElements() const {
987        return solver_->getNumElements();
988    }
989
990    /// Number of integers in problem
991    inline int numberIntegers() const {
992        return numberIntegers_;
993    }
994    // Integer variables
995    inline const int * integerVariable() const {
996        return integerVariable_;
997    }
998    /// Whether or not integer
999    inline char integerType(int i) const {
1000        assert (integerInfo_);
1001        assert (integerInfo_[i] == 0 || integerInfo_[i] == 1);
1002        return integerInfo_[i];
1003    }
1004    /// Whether or not integer
1005    inline const char * integerType() const {
1006        return integerInfo_;
1007    }
1008
1009    /// Get pointer to array[getNumCols()] of column lower bounds
1010    inline const double * getColLower() const {
1011        return solver_->getColLower();
1012    }
1013
1014    /// Get pointer to array[getNumCols()] of column upper bounds
1015    inline const double * getColUpper() const {
1016        return solver_->getColUpper();
1017    }
1018
1019    /** Get pointer to array[getNumRows()] of row constraint senses.
1020        <ul>
1021        <li>'L': <= constraint
1022        <li>'E': =  constraint
1023        <li>'G': >= constraint
1024        <li>'R': ranged constraint
1025        <li>'N': free constraint
1026        </ul>
1027    */
1028    inline const char * getRowSense() const {
1029        return solver_->getRowSense();
1030    }
1031
1032    /** Get pointer to array[getNumRows()] of rows right-hand sides
1033        <ul>
1034        <li> if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
1035        <li> if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
1036        <li> if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
1037        <li> if rowsense()[i] == 'N' then rhs()[i] == 0.0
1038        </ul>
1039    */
1040    inline const double * getRightHandSide() const {
1041        return solver_->getRightHandSide();
1042    }
1043
1044    /** Get pointer to array[getNumRows()] of row ranges.
1045        <ul>
1046        <li> if rowsense()[i] == 'R' then
1047        rowrange()[i] == rowupper()[i] - rowlower()[i]
1048        <li> if rowsense()[i] != 'R' then
1049        rowrange()[i] is 0.0
1050        </ul>
1051    */
1052    inline const double * getRowRange() const {
1053        return solver_->getRowRange();
1054    }
1055
1056    /// Get pointer to array[getNumRows()] of row lower bounds
1057    inline const double * getRowLower() const {
1058        return solver_->getRowLower();
1059    }
1060
1061    /// Get pointer to array[getNumRows()] of row upper bounds
1062    inline const double * getRowUpper() const {
1063        return solver_->getRowUpper();
1064    }
1065
1066    /// Get pointer to array[getNumCols()] of objective function coefficients
1067    inline const double * getObjCoefficients() const {
1068        return solver_->getObjCoefficients();
1069    }
1070
1071    /// Get objective function sense (1 for min (default), -1 for max)
1072    inline double getObjSense() const {
1073        //assert (dblParam_[CbcOptimizationDirection]== solver_->getObjSense());
1074        return dblParam_[CbcOptimizationDirection];
1075    }
1076
1077    /// Return true if variable is continuous
1078    inline bool isContinuous(int colIndex) const {
1079        return solver_->isContinuous(colIndex);
1080    }
1081
1082    /// Return true if variable is binary
1083    inline bool isBinary(int colIndex) const {
1084        return solver_->isBinary(colIndex);
1085    }
1086
1087    /** Return true if column is integer.
1088        Note: This function returns true if the the column
1089        is binary or a general integer.
1090    */
1091    inline bool isInteger(int colIndex) const {
1092        return solver_->isInteger(colIndex);
1093    }
1094
1095    /// Return true if variable is general integer
1096    inline bool isIntegerNonBinary(int colIndex) const {
1097        return solver_->isIntegerNonBinary(colIndex);
1098    }
1099
1100    /// Return true if variable is binary and not fixed at either bound
1101    inline bool isFreeBinary(int colIndex) const {
1102        return solver_->isFreeBinary(colIndex) ;
1103    }
1104
1105    /// Get pointer to row-wise copy of matrix
1106    inline const CoinPackedMatrix * getMatrixByRow() const {
1107        return solver_->getMatrixByRow();
1108    }
1109
1110    /// Get pointer to column-wise copy of matrix
1111    inline const CoinPackedMatrix * getMatrixByCol() const {
1112        return solver_->getMatrixByCol();
1113    }
1114
1115    /// Get solver's value for infinity
1116    inline double getInfinity() const {
1117        return solver_->getInfinity();
1118    }
1119    /// Get pointer to array[getNumCols()] (for speed) of column lower bounds
1120    inline const double * getCbcColLower() const {
1121        return cbcColLower_;
1122    }
1123    /// Get pointer to array[getNumCols()] (for speed) of column upper bounds
1124    inline const double * getCbcColUpper() const {
1125        return cbcColUpper_;
1126    }
1127    /// Get pointer to array[getNumRows()] (for speed) of row lower bounds
1128    inline const double * getCbcRowLower() const {
1129        return cbcRowLower_;
1130    }
1131    /// Get pointer to array[getNumRows()] (for speed) of row upper bounds
1132    inline const double * getCbcRowUpper() const {
1133        return cbcRowUpper_;
1134    }
1135    /// Get pointer to array[getNumCols()] (for speed) of primal solution vector
1136    inline const double * getCbcColSolution() const {
1137        return cbcColSolution_;
1138    }
1139    /// Get pointer to array[getNumRows()] (for speed) of dual prices
1140    inline const double * getCbcRowPrice() const {
1141        return cbcRowPrice_;
1142    }
1143    /// Get a pointer to array[getNumCols()] (for speed) of reduced costs
1144    inline const double * getCbcReducedCost() const {
1145        return cbcReducedCost_;
1146    }
1147    /// Get pointer to array[getNumRows()] (for speed) of row activity levels.
1148    inline const double * getCbcRowActivity() const {
1149        return cbcRowActivity_;
1150    }
1151    //@}
1152
1153
1154    /**@name Methods related to querying the solution */
1155    //@{
1156    /// Holds solution at continuous (after cuts if branchAndBound called)
1157    inline double * continuousSolution() const {
1158        return continuousSolution_;
1159    }
1160    /** Array marked whenever a solution is found if non-zero.
1161        Code marks if heuristic returns better so heuristic
1162        need only mark if it wants to on solutions which
1163        are worse than current */
1164    inline int * usedInSolution() const {
1165        return usedInSolution_;
1166    }
1167    /// Increases usedInSolution for nonzeros
1168    void incrementUsed(const double * solution);
1169    /// Record a new incumbent solution and update objectiveValue
1170    void setBestSolution(CBC_Message how,
1171                         double & objectiveValue, const double *solution,
1172                         int fixVariables = 0);
1173    /// Just update objectiveValue
1174    void setBestObjectiveValue( double objectiveValue);
1175    /// Deals with event handler and solution
1176    CbcEventHandler::CbcAction dealWithEventHandler(CbcEventHandler::CbcEvent event,
1177            double objValue,
1178            const double * solution);
1179
1180    /** Call this to really test if a valid solution can be feasible
1181        Solution is number columns in size.
1182        If fixVariables true then bounds of continuous solver updated.
1183        Returns objective value (worse than cutoff if not feasible)
1184        Previously computed objective value is now passed in (in case user does not do solve)
1185        virtual so user can override
1186    */
1187    virtual double checkSolution(double cutoff, double * solution,
1188                         int fixVariables, double originalObjValue);
1189    /** Test the current solution for feasiblility.
1190
1191      Scan all objects for indications of infeasibility. This is broken down
1192      into simple integer infeasibility (\p numberIntegerInfeasibilities)
1193      and all other reports of infeasibility (\p numberObjectInfeasibilities).
1194    */
1195    bool feasibleSolution(int & numberIntegerInfeasibilities,
1196                          int & numberObjectInfeasibilities) const;
1197
1198    /** Solution to the most recent lp relaxation.
1199
1200      The solver's solution to the most recent lp relaxation.
1201    */
1202
1203    inline double * currentSolution() const {
1204        return currentSolution_;
1205    }
1206    /** For testing infeasibilities - will point to
1207        currentSolution_ or solver-->getColSolution()
1208    */
1209    inline const double * testSolution() const {
1210        return testSolution_;
1211    }
1212    inline void setTestSolution(const double * solution) {
1213        testSolution_ = solution;
1214    }
1215    /// Make sure region there and optionally copy solution
1216    void reserveCurrentSolution(const double * solution = NULL);
1217
1218    /// Get pointer to array[getNumCols()] of primal solution vector
1219    inline const double * getColSolution() const {
1220        return solver_->getColSolution();
1221    }
1222
1223    /// Get pointer to array[getNumRows()] of dual prices
1224    inline const double * getRowPrice() const {
1225        return solver_->getRowPrice();
1226    }
1227
1228    /// Get a pointer to array[getNumCols()] of reduced costs
1229    inline const double * getReducedCost() const {
1230        return solver_->getReducedCost();
1231    }
1232
1233    /// Get pointer to array[getNumRows()] of row activity levels.
1234    inline const double * getRowActivity() const {
1235        return solver_->getRowActivity();
1236    }
1237
1238    /// Get current objective function value
1239    inline double getCurrentObjValue() const {
1240        return dblParam_[CbcCurrentObjectiveValue];
1241    }
1242    /// Get current minimization objective function value
1243    inline double getCurrentMinimizationObjValue() const {
1244        return dblParam_[CbcCurrentMinimizationObjectiveValue];
1245    }
1246
1247    /// Get best objective function value as minimization
1248    inline double getMinimizationObjValue() const {
1249        return bestObjective_;
1250    }
1251    /// Set best objective function value as minimization
1252    inline void setMinimizationObjValue(double value) {
1253        bestObjective_ = value;
1254    }
1255
1256    /// Get best objective function value
1257    inline double getObjValue() const {
1258        return bestObjective_ * solver_->getObjSense() ;
1259    }
1260    /** Get best possible objective function value.
1261        This is better of best possible left on tree
1262        and best solution found.
1263        If called from within branch and cut may be optimistic.
1264    */
1265    double getBestPossibleObjValue() const;
1266    /// Set best objective function value
1267    inline void setObjValue(double value) {
1268        bestObjective_ = value * solver_->getObjSense() ;
1269    }
1270    /// Get solver objective function value (as minimization)
1271    inline double getSolverObjValue() const {
1272        return solver_->getObjValue() * solver_->getObjSense() ;
1273    }
1274
1275    /** The best solution to the integer programming problem.
1276
1277      The best solution to the integer programming problem found during
1278      the search. If no solution is found, the method returns null.
1279    */
1280
1281    inline double * bestSolution() const {
1282        return bestSolution_;
1283    }
1284    /** User callable setBestSolution.
1285        If check false does not check valid
1286        If true then sees if feasible and warns if objective value
1287        worse than given (so just set to COIN_DBL_MAX if you don't care).
1288        If check true then does not save solution if not feasible
1289    */
1290    void setBestSolution(const double * solution, int numberColumns,
1291                         double objectiveValue, bool check = false);
1292
1293    /// Get number of solutions
1294    inline int getSolutionCount() const {
1295        return numberSolutions_;
1296    }
1297
1298    /// Set number of solutions (so heuristics will be different)
1299    inline void setSolutionCount(int value) {
1300        numberSolutions_ = value;
1301    }
1302    /// Number of saved solutions (including best)
1303    int numberSavedSolutions() const;
1304    /// Maximum number of extra saved solutions
1305    inline int maximumSavedSolutions() const {
1306        return maximumSavedSolutions_;
1307    }
1308    /// Set maximum number of extra saved solutions
1309    void setMaximumSavedSolutions(int value);
1310    /// Return a saved solution (0==best) - NULL if off end
1311    const double * savedSolution(int which) const;
1312    /// Return a saved solution objective (0==best) - COIN_DBL_MAX if off end
1313    double savedSolutionObjective(int which) const;
1314    /// Delete a saved solution and move others up
1315    void deleteSavedSolution(int which);
1316
1317    /** Current phase (so heuristics etc etc can find out).
1318        0 - initial solve
1319        1 - solve with cuts at root
1320        2 - solve with cuts
1321        3 - other e.g. strong branching
1322        4 - trying to validate a solution
1323        5 - at end of search
1324    */
1325    inline int phase() const {
1326        return phase_;
1327    }
1328
1329    /// Get number of heuristic solutions
1330    inline int getNumberHeuristicSolutions() const {
1331        return numberHeuristicSolutions_;
1332    }
1333    /// Set number of heuristic solutions
1334    inline void setNumberHeuristicSolutions(int value) {
1335        numberHeuristicSolutions_ = value;
1336    }
1337
1338    /// Set objective function sense (1 for min (default), -1 for max,)
1339    inline void setObjSense(double s) {
1340        dblParam_[CbcOptimizationDirection] = s;
1341        solver_->setObjSense(s);
1342    }
1343
1344    /// Value of objective at continuous
1345    inline double getContinuousObjective() const {
1346        return originalContinuousObjective_;
1347    }
1348    inline void setContinuousObjective(double value) {
1349        originalContinuousObjective_ = value;
1350    }
1351    /// Number of infeasibilities at continuous
1352    inline int getContinuousInfeasibilities() const {
1353        return continuousInfeasibilities_;
1354    }
1355    inline void setContinuousInfeasibilities(int value) {
1356        continuousInfeasibilities_ = value;
1357    }
1358    /// Value of objective after root node cuts added
1359    inline double rootObjectiveAfterCuts() const {
1360        return continuousObjective_;
1361    }
1362    /// Sum of Changes to objective by first solve
1363    inline double sumChangeObjective() const {
1364        return sumChangeObjective1_;
1365    }
1366    /** Number of times global cuts violated.  When global cut pool then this
1367        should be kept for each cut and type of cut */
1368    inline int numberGlobalViolations() const {
1369        return numberGlobalViolations_;
1370    }
1371    inline void clearNumberGlobalViolations() {
1372        numberGlobalViolations_ = 0;
1373    }
1374    /// Whether to force a resolve after takeOffCuts
1375    inline bool resolveAfterTakeOffCuts() const {
1376        return resolveAfterTakeOffCuts_;
1377    }
1378    inline void setResolveAfterTakeOffCuts(bool yesNo) {
1379        resolveAfterTakeOffCuts_ = yesNo;
1380    }
1381    /// Maximum number of rows
1382    inline int maximumRows() const {
1383        return maximumRows_;
1384    }
1385    /// Work basis for temporary use
1386    inline CoinWarmStartBasis & workingBasis() {
1387        return workingBasis_;
1388    }
1389    /// Get number of "iterations" to stop after
1390    inline int getStopNumberIterations() const {
1391        return stopNumberIterations_;
1392    }
1393    /// Set number of "iterations" to stop after
1394    inline void setStopNumberIterations(int value) {
1395        stopNumberIterations_ = value;
1396    }
1397    //@}
1398
1399    /** \name Node selection */
1400    //@{
1401    // Comparison functions (which may be overridden by inheritance)
1402    inline CbcCompareBase * nodeComparison() const {
1403        return nodeCompare_;
1404    }
1405    void setNodeComparison(CbcCompareBase * compare);
1406    void setNodeComparison(CbcCompareBase & compare);
1407    //@}
1408
1409    /** \name Problem feasibility checking */
1410    //@{
1411    // Feasibility functions (which may be overridden by inheritance)
1412    inline CbcFeasibilityBase * problemFeasibility() const {
1413        return problemFeasibility_;
1414    }
1415    void setProblemFeasibility(CbcFeasibilityBase * feasibility);
1416    void setProblemFeasibility(CbcFeasibilityBase & feasibility);
1417    //@}
1418
1419    /** \name Tree methods and subtree methods */
1420    //@{
1421    /// Tree method e.g. heap (which may be overridden by inheritance)
1422    inline CbcTree * tree() const {
1423        return tree_;
1424    }
1425    /// For modifying tree handling (original is cloned)
1426    void passInTreeHandler(CbcTree & tree);
1427    /** For passing in an CbcModel to do a sub Tree (with derived tree handlers).
1428        Passed in model must exist for duration of branch and bound
1429    */
1430    void passInSubTreeModel(CbcModel & model);
1431    /** For retrieving a copy of subtree model with given OsiSolver.
1432        If no subtree model will use self (up to user to reset cutoff etc).
1433        If solver NULL uses current
1434    */
1435    CbcModel * subTreeModel(OsiSolverInterface * solver = NULL) const;
1436    /// Returns number of times any subtree stopped on nodes, time etc
1437    inline int numberStoppedSubTrees() const {
1438        return numberStoppedSubTrees_;
1439    }
1440    /// Says a sub tree was stopped
1441    inline void incrementSubTreeStopped() {
1442        numberStoppedSubTrees_++;
1443    }
1444    /** Whether to automatically do presolve before branch and bound (subTrees).
1445        0 - no
1446        1 - ordinary presolve
1447        2 - integer presolve (dodgy)
1448    */
1449    inline int typePresolve() const {
1450        return presolve_;
1451    }
1452    inline void setTypePresolve(int value) {
1453        presolve_ = value;
1454    }
1455
1456    //@}
1457
1458    /** \name Branching Decisions
1459
1460      See the CbcBranchDecision class for additional information.
1461    */
1462    //@{
1463
1464    /// Get the current branching decision method.
1465    inline CbcBranchDecision * branchingMethod() const {
1466        return branchingMethod_;
1467    }
1468    /// Set the branching decision method.
1469    inline void setBranchingMethod(CbcBranchDecision * method) {
1470        delete branchingMethod_;
1471        branchingMethod_ = method->clone();
1472    }
1473    /** Set the branching method
1474
1475      \overload
1476    */
1477    inline void setBranchingMethod(CbcBranchDecision & method) {
1478        delete branchingMethod_;
1479        branchingMethod_ = method.clone();
1480    }
1481    /// Get the current cut modifier method
1482    inline CbcCutModifier * cutModifier() const {
1483        return cutModifier_;
1484    }
1485    /// Set the cut modifier method
1486    void setCutModifier(CbcCutModifier * modifier);
1487    /** Set the cut modifier method
1488
1489      \overload
1490    */
1491    void setCutModifier(CbcCutModifier & modifier);
1492    //@}
1493
1494    /** \name Row (constraint) and Column (variable) cut generation */
1495    //@{
1496
1497    /** State of search
1498        0 - no solution
1499        1 - only heuristic solutions
1500        2 - branched to a solution
1501        3 - no solution but many nodes
1502    */
1503    inline int stateOfSearch() const {
1504        return stateOfSearch_;
1505    }
1506    inline void setStateOfSearch(int state) {
1507        stateOfSearch_ = state;
1508    }
1509    /// Strategy worked out - mainly at root node for use by CbcNode
1510    inline int searchStrategy() const {
1511        return searchStrategy_;
1512    }
1513    /// Set strategy worked out - mainly at root node for use by CbcNode
1514    inline void setSearchStrategy(int value) {
1515        searchStrategy_ = value;
1516    }
1517
1518    /// Get the number of cut generators
1519    inline int numberCutGenerators() const {
1520        return numberCutGenerators_;
1521    }
1522    /// Get the list of cut generators
1523    inline CbcCutGenerator ** cutGenerators() const {
1524        return generator_;
1525    }
1526    ///Get the specified cut generator
1527    inline CbcCutGenerator * cutGenerator(int i) const {
1528        return generator_[i];
1529    }
1530    ///Get the specified cut generator before any changes
1531    inline CbcCutGenerator * virginCutGenerator(int i) const {
1532        return virginGenerator_[i];
1533    }
1534    /** Add one generator - up to user to delete generators.
1535        howoften affects how generator is used. 0 or 1 means always,
1536        >1 means every that number of nodes.  Negative values have same
1537        meaning as positive but they may be switched off (-> -100) by code if
1538        not many cuts generated at continuous.  -99 is just done at root.
1539        Name is just for printout.
1540        If depth >0 overrides how often generator is called (if howOften==-1 or >0).
1541    */
1542    void addCutGenerator(CglCutGenerator * generator,
1543                         int howOften = 1, const char * name = NULL,
1544                         bool normal = true, bool atSolution = false,
1545                         bool infeasible = false, int howOftenInSub = -100,
1546                         int whatDepth = -1, int whatDepthInSub = -1);
1547//@}
1548    /** \name Strategy and sub models
1549
1550      See the CbcStrategy class for additional information.
1551    */
1552    //@{
1553
1554    /// Get the current strategy
1555    inline CbcStrategy * strategy() const {
1556        return strategy_;
1557    }
1558    /// Set the strategy. Clones
1559    void setStrategy(CbcStrategy & strategy);
1560    /// Set the strategy. assigns
1561    inline void setStrategy(CbcStrategy * strategy) {
1562        strategy_ = strategy;
1563    }
1564    /// Get the current parent model
1565    inline CbcModel * parentModel() const {
1566        return parentModel_;
1567    }
1568    /// Set the parent model
1569    inline void setParentModel(CbcModel & parentModel) {
1570        parentModel_ = &parentModel;
1571    }
1572    //@}
1573
1574
1575    /** \name Heuristics and priorities */
1576    //@{
1577    /*! \brief Add one heuristic - up to user to delete
1578
1579      The name is just used for print messages.
1580    */
1581    void addHeuristic(CbcHeuristic * generator, const char *name = NULL,
1582                      int before = -1);
1583    ///Get the specified heuristic
1584    inline CbcHeuristic * heuristic(int i) const {
1585        return heuristic_[i];
1586    }
1587    /// Get the number of heuristics
1588    inline int numberHeuristics() const {
1589        return numberHeuristics_;
1590    }
1591    /// Set the number of heuristics
1592    inline void setNumberHeuristics(int value) {
1593        numberHeuristics_ = value;
1594    }
1595    /// Pointer to heuristic solver which found last solution (or NULL)
1596    inline CbcHeuristic * lastHeuristic() const {
1597        return lastHeuristic_;
1598    }
1599    /// set last heuristic which found a solution
1600    inline void setLastHeuristic(CbcHeuristic * last) {
1601        lastHeuristic_ = last;
1602    }
1603
1604    /** Pass in branching priorities.
1605
1606        If ifClique then priorities are on cliques otherwise priorities are
1607        on integer variables.
1608        Other type (if exists set to default)
1609        1 is highest priority. (well actually -INT_MAX is but that's ugly)
1610        If hotstart > 0 then branches are created to force
1611        the variable to the value given by best solution.  This enables a
1612        sort of hot start.  The node choice should be greatest depth
1613        and hotstart should normally be switched off after a solution.
1614
1615        If ifNotSimpleIntegers true then appended to normal integers
1616
1617        This is now deprecated except for simple usage.  If user
1618        creates Cbcobjects then set priority in them
1619
1620        \internal Added for Kurt Spielberg.
1621    */
1622    void passInPriorities(const int * priorities, bool ifNotSimpleIntegers);
1623
1624    /// Returns priority level for an object (or 1000 if no priorities exist)
1625    inline int priority(int sequence) const {
1626        return object_[sequence]->priority();
1627    }
1628
1629    /*! \brief Set an event handler
1630
1631      A clone of the handler passed as a parameter is stored in CbcModel.
1632    */
1633    void passInEventHandler(const CbcEventHandler *eventHandler) ;
1634
1635    /*! \brief Retrieve a pointer to the event handler */
1636    inline CbcEventHandler* getEventHandler() const {
1637        return (eventHandler_) ;
1638    }
1639
1640    //@}
1641
1642    /**@name Setting/Accessing application data */
1643    //@{
1644    /** Set application data.
1645
1646    This is a pointer that the application can store into and
1647    retrieve from the solver interface.
1648    This field is available for the application to optionally
1649    define and use.
1650    */
1651    void setApplicationData (void * appData);
1652
1653    /// Get application data
1654    void * getApplicationData() const;
1655    /**
1656        For advanced applications you may wish to modify the behavior of Cbc
1657        e.g. if the solver is a NLP solver then you may not have an exact
1658        optimum solution at each step.  Information could be built into
1659        OsiSolverInterface but this is an alternative so that that interface
1660        does not have to be changed.  If something similar is useful to
1661        enough solvers then it could be migrated
1662        You can also pass in by using solver->setAuxiliaryInfo.
1663        You should do that if solver is odd - if solver is normal simplex
1664        then use this.
1665        NOTE - characteristics are not cloned
1666    */
1667    void passInSolverCharacteristics(OsiBabSolver * solverCharacteristics);
1668    /// Get solver characteristics
1669    inline const OsiBabSolver * solverCharacteristics() const {
1670        return solverCharacteristics_;
1671    }
1672    //@}
1673
1674    //---------------------------------------------------------------------------
1675
1676    /**@name Message handling etc */
1677    //@{
1678    /// Pass in Message handler (not deleted at end)
1679    void passInMessageHandler(CoinMessageHandler * handler);
1680    /// Set language
1681    void newLanguage(CoinMessages::Language language);
1682    inline void setLanguage(CoinMessages::Language language) {
1683        newLanguage(language);
1684    }
1685    /// Return handler
1686    inline CoinMessageHandler * messageHandler() const {
1687        return handler_;
1688    }
1689    /// Return messages
1690    inline CoinMessages & messages() {
1691        return messages_;
1692    }
1693    /// Return pointer to messages
1694    inline CoinMessages * messagesPointer() {
1695        return &messages_;
1696    }
1697    /// Set log level
1698    void setLogLevel(int value);
1699    /// Get log level
1700    inline int logLevel() const {
1701        return handler_->logLevel();
1702    }
1703    /** Set flag to say if handler_ is the default handler.
1704
1705      The default handler is deleted when the model is deleted. Other
1706      handlers (supplied by the client) will not be deleted.
1707    */
1708    inline void setDefaultHandler(bool yesNo) {
1709        defaultHandler_ = yesNo;
1710    }
1711    //@}
1712    //---------------------------------------------------------------------------
1713    ///@name Specialized
1714    //@{
1715
1716    /**
1717        Set special options
1718        0 bit (1) - check if cuts valid (if on debugger list)
1719        1 bit (2) - use current basis to check integer solution (rather than all slack)
1720        2 bit (4) - don't check integer solution (by solving LP)
1721        3 bit (8) - fast analyze
1722        4 bit (16) - non-linear model - so no well defined CoinPackedMatrix
1723        5 bit (32) - keep names
1724        6 bit (64) - try for dominated columns
1725        7 bit (128) - SOS type 1 but all declared integer
1726        8 bit (256) - Set to say solution just found, unset by doing cuts
1727        9 bit (512) - Try reduced model after 100 nodes
1728        10 bit (1024) - Switch on some heuristics even if seems unlikely
1729        11 bit (2048) - Mark as in small branch and bound
1730        12 bit (4096) - Funny cuts so do slow way (in some places)
1731        13 bit (8192) - Funny cuts so do slow way (in other places)
1732        14 bit (16384) - Use Cplex! for fathoming
1733        15 bit (32768) - Try reduced model after 0 nodes
1734        16 bit (65536) - Original model had integer bounds
1735        17 bit (131072) - Perturbation switched off
1736        18 bit (262144) - donor CbcModel
1737        19 bit (524288) - recipient CbcModel
1738        20 bit (1048576) - waiting for sub model to return
1739        22 bit (4194304) - do not initialize random seed in solver (user has)
1740    */
1741    inline void setSpecialOptions(int value) {
1742        specialOptions_ = value;
1743    }
1744    /// Get special options
1745    inline int specialOptions() const {
1746        return specialOptions_;
1747    }
1748    /// Set random seed
1749    inline void setRandomSeed(int value) {
1750        randomSeed_ = value;
1751    }
1752    /// Get random seed
1753    inline int getRandomSeed() const {
1754        return randomSeed_;
1755    }
1756    /// Tell model to stop on event
1757    inline void sayEventHappened()
1758    { eventHappened_=true;}
1759    /// Says if normal solver i.e. has well defined CoinPackedMatrix
1760    inline bool normalSolver() const {
1761        return (specialOptions_&16) == 0;
1762    }
1763    /** Says if model is sitting there waiting for mini branch and bound to finish
1764        This is because an event handler may only have access to parent model in
1765        mini branch and bound
1766    */
1767    inline bool waitingForMiniBranchAndBound() const {
1768        return (specialOptions_&1048576) != 0;
1769    }
1770    /** Set more special options
1771        at present bottom 6 bits used for shadow price mode
1772        1024 for experimental hotstart
1773        2048,4096 breaking out of cuts
1774        8192 slowly increase minimum drop
1775        16384 gomory
1776        32768 more heuristics in sub trees
1777        65536 no cuts in preprocessing
1778        131072 Time limits elapsed
1779        18 bit (262144) - Perturb fathom nodes
1780        19 bit (524288) - No limit on fathom nodes
1781        20 bit (1048576) - Reduce sum of infeasibilities before cuts
1782        21 bit (2097152) - Reduce sum of infeasibilities after cuts
1783    */
1784    inline void setMoreSpecialOptions(int value) {
1785        moreSpecialOptions_ = value;
1786    }
1787    /// Get more special options
1788    inline int moreSpecialOptions() const {
1789        return moreSpecialOptions_;
1790    }
1791  /// Set time method
1792    inline void setUseElapsedTime(bool yesNo) {
1793        if (yesNo)
1794          moreSpecialOptions_ |= 131072;
1795        else
1796          moreSpecialOptions_ &= ~131072;
1797    }
1798    /// Get time method
1799    inline bool useElapsedTime() const {
1800        return (moreSpecialOptions_&131072)!=0;
1801    }
1802    /// Go to dantzig pivot selection if easy problem (clp only)
1803#ifdef COIN_HAS_CLP
1804    void goToDantzig(int numberNodes, ClpDualRowPivot *& savePivotMethod);
1805#endif
1806    /// Now we may not own objects - just point to solver's objects
1807    inline bool ownObjects() const {
1808        return ownObjects_;
1809    }
1810    /// Check original model before it gets messed up
1811    void checkModel();
1812    //@}
1813    //---------------------------------------------------------------------------
1814
1815    ///@name Constructors and destructors etc
1816    //@{
1817    /// Default Constructor
1818    CbcModel();
1819
1820    /// Constructor from solver
1821    CbcModel(const OsiSolverInterface &);
1822
1823    /** Assign a solver to the model (model assumes ownership)
1824
1825      On return, \p solver will be NULL.
1826      If deleteSolver then current solver deleted (if model owned)
1827
1828      \note Parameter settings in the outgoing solver are not inherited by
1829        the incoming solver.
1830    */
1831    void assignSolver(OsiSolverInterface *&solver, bool deleteSolver = true);
1832
1833    /** \brief Set ownership of solver
1834
1835      A parameter of false tells CbcModel it does not own the solver and
1836      should not delete it. Once you claim ownership of the solver, you're
1837      responsible for eventually deleting it. Note that CbcModel clones
1838      solvers with abandon.  Unless you have a deep understanding of the
1839      workings of CbcModel, the only time you want to claim ownership is when
1840      you're about to delete the CbcModel object but want the solver to
1841      continue to exist (as, for example, when branchAndBound has finished
1842      and you want to hang on to the answer).
1843    */
1844    inline void setModelOwnsSolver (bool ourSolver) {
1845        ownership_ = ourSolver ? (ownership_ | 0x80000000) : (ownership_ & (~0x80000000)) ;
1846    }
1847
1848    /*! \brief Get ownership of solver
1849
1850      A return value of true means that CbcModel owns the solver and will
1851      take responsibility for deleting it when that becomes necessary.
1852    */
1853    inline bool modelOwnsSolver () {
1854        return ((ownership_&0x80000000) != 0) ;
1855    }
1856
1857    /** Copy constructor .
1858      If cloneHandler is true then message handler is cloned
1859    */
1860    CbcModel(const CbcModel & rhs, bool cloneHandler = false);
1861
1862    /// Assignment operator
1863    CbcModel & operator=(const CbcModel& rhs);
1864
1865    /// Destructor
1866    virtual ~CbcModel ();
1867
1868    /// Returns solver - has current state
1869    inline OsiSolverInterface * solver() const {
1870        return solver_;
1871    }
1872
1873    /// Returns current solver - sets new one
1874    inline OsiSolverInterface * swapSolver(OsiSolverInterface * solver) {
1875        OsiSolverInterface * returnSolver = solver_;
1876        solver_ = solver;
1877        return returnSolver;
1878    }
1879
1880    /// Returns solver with continuous state
1881    inline OsiSolverInterface * continuousSolver() const {
1882        return continuousSolver_;
1883    }
1884
1885    /// Create solver with continuous state
1886    inline void createContinuousSolver() {
1887        continuousSolver_ = solver_->clone();
1888    }
1889    /// Clear solver with continuous state
1890    inline void clearContinuousSolver() {
1891        delete continuousSolver_;
1892        continuousSolver_ = NULL;
1893    }
1894
1895    /// A copy of the solver, taken at constructor or by saveReferenceSolver
1896    inline OsiSolverInterface * referenceSolver() const {
1897        return referenceSolver_;
1898    }
1899
1900    /// Save a copy of the current solver so can be reset to
1901    void saveReferenceSolver();
1902
1903    /** Uses a copy of reference solver to be current solver.
1904        Because of possible mismatches all exotic integer information is loat
1905        (apart from normal information in OsiSolverInterface)
1906        so SOS etc and priorities will have to be redone
1907    */
1908    void resetToReferenceSolver();
1909
1910    /// Clears out as much as possible (except solver)
1911    void gutsOfDestructor();
1912    /** Clears out enough to reset CbcModel as if no branch and bound done
1913     */
1914    void gutsOfDestructor2();
1915    /** Clears out enough to reset CbcModel cutoff etc
1916     */
1917    void resetModel();
1918    /** Most of copy constructor
1919        mode - 0 copy but don't delete before
1920               1 copy and delete before
1921           2 copy and delete before (but use virgin generators)
1922    */
1923    void gutsOfCopy(const CbcModel & rhs, int mode = 0);
1924    /// Move status, nodes etc etc across
1925    void moveInfo(const CbcModel & rhs);
1926    //@}
1927
1928    ///@name Multithreading
1929    //@{
1930    /// Indicates whether Cbc library has been compiled with multithreading support
1931    static bool haveMultiThreadSupport();
1932    /// Get pointer to masterthread
1933    CbcThread * masterThread() const {
1934        return masterThread_;
1935    }
1936    /// Get pointer to walkback
1937    CbcNodeInfo ** walkback() const {
1938        return walkback_;
1939    }
1940    /// Get number of threads
1941    inline int getNumberThreads() const {
1942        return numberThreads_;
1943    }
1944    /// Set number of threads
1945    inline void setNumberThreads(int value) {
1946        numberThreads_ = value;
1947    }
1948    /// Get thread mode
1949    inline int getThreadMode() const {
1950        return threadMode_;
1951    }
1952    /** Set thread mode
1953        always use numberThreads for branching
1954        1 set then deterministic
1955        2 set then use numberThreads for root cuts
1956        4 set then use numberThreads in root mini branch and bound
1957        8 set and numberThreads - do heuristics numberThreads at a time
1958        8 set and numberThreads==0 do all heuristics at once
1959        default is 0
1960    */
1961    inline void setThreadMode(int value) {
1962        threadMode_ = value;
1963    }
1964    /** Return
1965        -2 if deterministic threaded and main thread
1966        -1 if deterministic threaded and serial thread
1967        0 if serial
1968        1 if opportunistic threaded
1969    */
1970    inline int parallelMode() const {
1971        if (!numberThreads_) {
1972            if ((threadMode_&1) == 0)
1973                return 0;
1974            else
1975                return -1;
1976            return 0;
1977        } else {
1978            if ((threadMode_&1) == 0)
1979                return 1;
1980            else
1981                return -2;
1982        }
1983    }
1984    /// From here to end of section - code in CbcThread.cpp until class changed
1985    /// Returns true if locked
1986    bool isLocked() const;
1987#ifdef CBC_THREAD
1988    /**
1989       Locks a thread if parallel so that stuff like cut pool
1990       can be updated and/or used.
1991    */
1992    void lockThread();
1993    /**
1994       Unlocks a thread if parallel to say cut pool stuff not needed
1995    */
1996    void unlockThread();
1997#else
1998    inline void lockThread() {}
1999    inline void unlockThread() {}
2000#endif
2001    /** Set information in a child
2002        -3 pass pointer to child thread info
2003        -2 just stop
2004        -1 delete simple child stuff
2005        0 delete opportunistic child stuff
2006        1 delete deterministic child stuff
2007    */
2008    void setInfoInChild(int type, CbcThread * info);
2009    /** Move/copy information from one model to another
2010        -1 - initialization
2011        0 - from base model
2012        1 - to base model (and reset)
2013        2 - add in final statistics etc (and reset so can do clean destruction)
2014    */
2015    void moveToModel(CbcModel * baseModel, int mode);
2016    /// Split up nodes
2017    int splitModel(int numberModels, CbcModel ** model,
2018                   int numberNodes);
2019    /// Start threads
2020    void startSplitModel(int numberIterations);
2021    /// Merge models
2022    void mergeModels(int numberModel, CbcModel ** model,
2023                     int numberNodes);
2024    //@}
2025
2026    ///@name semi-private i.e. users should not use
2027    //@{
2028    /// Get how many Nodes it took to solve the problem.
2029    int getNodeCount2() const {
2030        return numberNodes2_;
2031    }
2032    /// Set pointers for speed
2033    void setPointers(const OsiSolverInterface * solver);
2034    /** Perform reduced cost fixing
2035
2036      Fixes integer variables at their current value based on reduced cost
2037      penalties.  Returns number fixed
2038    */
2039    int reducedCostFix() ;
2040    /** Makes all handlers same.  If makeDefault 1 then makes top level
2041        default and rest point to that.  If 2 then each is copy
2042    */
2043    void synchronizeHandlers(int makeDefault);
2044    /// Save a solution to saved list
2045    void saveExtraSolution(const double * solution, double objectiveValue);
2046    /// Save a solution to best and move current to saved
2047    void saveBestSolution(const double * solution, double objectiveValue);
2048    /// Delete best and saved solutions
2049    void deleteSolutions();
2050    /// Encapsulates solver resolve
2051    int resolve(OsiSolverInterface * solver);
2052#ifdef CLP_RESOLVE
2053    /// Special purpose resolve
2054    int resolveClp(OsiClpSolverInterface * solver, int type);
2055#endif
2056
2057    /** Encapsulates choosing a variable -
2058        anyAction -2, infeasible (-1 round again), 0 done
2059    */
2060    int chooseBranch(CbcNode * & newNode, int numberPassesLeft,
2061                     CbcNode * oldNode, OsiCuts & cuts,
2062                     bool & resolved, CoinWarmStartBasis *lastws,
2063                     const double * lowerBefore, const double * upperBefore,
2064                     OsiSolverBranch * & branches);
2065    int chooseBranch(CbcNode * newNode, int numberPassesLeft, bool & resolved);
2066
2067    /** Return an empty basis object of the specified size
2068
2069      A useful utility when constructing a basis for a subproblem from scratch.
2070      The object returned will be of the requested capacity and appropriate for
2071      the solver attached to the model.
2072    */
2073    CoinWarmStartBasis *getEmptyBasis(int ns = 0, int na = 0) const ;
2074
2075    /** Remove inactive cuts from the model
2076
2077      An OsiSolverInterface is expected to maintain a valid basis, but not a
2078      valid solution, when loose cuts are deleted. Restoring a valid solution
2079      requires calling the solver to reoptimise. If it's certain the solution
2080      will not be required, set allowResolve to false to suppress
2081      reoptimisation.
2082      If saveCuts then slack cuts will be saved
2083      On input current cuts are cuts and newCuts
2084      on exit current cuts will be correct.  Returns number dropped
2085    */
2086    int takeOffCuts(OsiCuts &cuts,
2087                    bool allowResolve, OsiCuts * saveCuts,
2088                    int numberNewCuts = 0, const OsiRowCut ** newCuts = NULL) ;
2089
2090    /** Determine and install the active cuts that need to be added for
2091      the current subproblem
2092
2093      The whole truth is a bit more complicated. The first action is a call to
2094      addCuts1(). addCuts() then sorts through the list, installs the tight
2095      cuts in the model, and does bookkeeping (adjusts reference counts).
2096      The basis returned from addCuts1() is adjusted accordingly.
2097
2098      If it turns out that the node should really be fathomed by bound,
2099      addCuts() simply treats all the cuts as loose as it does the bookkeeping.
2100
2101      canFix true if extra information being passed
2102    */
2103    int addCuts(CbcNode * node, CoinWarmStartBasis *&lastws, bool canFix);
2104
2105    /** Traverse the tree from node to root and prep the model
2106
2107      addCuts1() begins the job of prepping the model to match the current
2108      subproblem. The model is stripped of all cuts, and the search tree is
2109      traversed from node to root to determine the changes required. Appropriate
2110      bounds changes are installed, a list of cuts is collected but not
2111      installed, and an appropriate basis (minus the cuts, but big enough to
2112      accommodate them) is constructed.
2113
2114      Returns true if new problem similar to old
2115
2116      \todo addCuts1() is called in contexts where it's known in advance that
2117        all that's desired is to determine a list of cuts and do the
2118        bookkeeping (adjust the reference counts). The work of installing
2119        bounds and building a basis goes to waste.
2120    */
2121    bool addCuts1(CbcNode * node, CoinWarmStartBasis *&lastws);
2122    /** Returns bounds just before where - initially original bounds.
2123        Also sets downstream nodes (lower if force 1, upper if 2)
2124    */
2125    void previousBounds (CbcNode * node, CbcNodeInfo * where, int iColumn,
2126                         double & lower, double & upper, int force);
2127    /** Set objective value in a node.  This is separated out so that
2128       odd solvers can use.  It may look at extra information in
2129       solverCharacteriscs_ and will also use bound from parent node
2130    */
2131    void setObjectiveValue(CbcNode * thisNode, const CbcNode * parentNode) const;
2132
2133    /** If numberBeforeTrust >0 then we are going to use CbcBranchDynamic.
2134        Scan and convert CbcSimpleInteger objects
2135    */
2136    void convertToDynamic();
2137    /// Set numberBeforeTrust in all objects
2138    void synchronizeNumberBeforeTrust(int type = 0);
2139    /// Zap integer information in problem (may leave object info)
2140    void zapIntegerInformation(bool leaveObjects = true);
2141    /// Use cliques for pseudocost information - return nonzero if infeasible
2142    int cliquePseudoCosts(int doStatistics);
2143    /// Fill in useful estimates
2144    void pseudoShadow(int type);
2145    /** Return pseudo costs
2146        If not all integers or not pseudo costs - returns all zero
2147        Length of arrays are numberIntegers() and entries
2148        correspond to integerVariable()[i]
2149        User must allocate arrays before call
2150    */
2151    void fillPseudoCosts(double * downCosts, double * upCosts,
2152                         int * priority = NULL,
2153                         int * numberDown = NULL, int * numberUp = NULL,
2154                         int * numberDownInfeasible = NULL,
2155                         int * numberUpInfeasible = NULL) const;
2156    /** Do heuristics at root.
2157        0 - don't delete
2158        1 - delete
2159        2 - just delete - don't even use
2160    */
2161    void doHeuristicsAtRoot(int deleteHeuristicsAfterwards = 0);
2162    /// Adjust heuristics based on model
2163    void adjustHeuristics();
2164    /// Get the hotstart solution
2165    inline const double * hotstartSolution() const {
2166        return hotstartSolution_;
2167    }
2168    /// Get the hotstart priorities
2169    inline const int * hotstartPriorities() const {
2170        return hotstartPriorities_;
2171    }
2172
2173    /// Return the list of cuts initially collected for this subproblem
2174    inline CbcCountRowCut ** addedCuts() const {
2175        return addedCuts_;
2176    }
2177    /// Number of entries in the list returned by #addedCuts()
2178    inline int currentNumberCuts() const {
2179        return currentNumberCuts_;
2180    }
2181    /// Global cuts
2182    inline OsiCuts * globalCuts() {
2183        return &globalCuts_;
2184    }
2185    /// Copy and set a pointer to a row cut which will be added instead of normal branching.
2186    void setNextRowCut(const OsiRowCut & cut);
2187    /// Get a pointer to current node (be careful)
2188    inline CbcNode * currentNode() const {
2189        return currentNode_;
2190    }
2191    /// Get a pointer to probing info
2192    inline CglTreeProbingInfo * probingInfo() const {
2193        return probingInfo_;
2194    }
2195    /// Thread specific random number generator
2196    inline CoinThreadRandom * randomNumberGenerator() {
2197        return &randomNumberGenerator_;
2198    }
2199    /// Set the number of iterations done in strong branching.
2200    inline void setNumberStrongIterations(int number) {
2201        numberStrongIterations_ = number;
2202    }
2203    /// Get the number of iterations done in strong branching.
2204    inline int numberStrongIterations() const {
2205        return numberStrongIterations_;
2206    }
2207    /// Get maximum number of iterations (designed to be used in heuristics)
2208    inline int maximumNumberIterations() const {
2209        return maximumNumberIterations_;
2210    }
2211    /// Set maximum number of iterations (designed to be used in heuristics)
2212    inline void setMaximumNumberIterations(int value) {
2213        maximumNumberIterations_ = value;
2214    }
2215# ifdef COIN_HAS_CLP
2216    /// Set depth for fast nodes
2217    inline void setFastNodeDepth(int value) {
2218        fastNodeDepth_ = value;
2219    }
2220    /// Get depth for fast nodes
2221    inline int fastNodeDepth() const {
2222        return fastNodeDepth_;
2223    }
2224    /// Get anything with priority >= this can be treated as continuous
2225    inline int continuousPriority() const {
2226        return continuousPriority_;
2227    }
2228    /// Set anything with priority >= this can be treated as continuous
2229    inline void setContinuousPriority(int value) {
2230        continuousPriority_ = value;
2231    }
2232    inline void incrementExtra(int nodes, int iterations) {
2233        numberExtraNodes_ += nodes;
2234        numberExtraIterations_ += iterations;
2235    }
2236#endif
2237    /// Number of extra iterations
2238    inline int numberExtraIterations() const {
2239        return numberExtraIterations_;
2240    }
2241    /// Increment strong info
2242    void incrementStrongInfo(int numberTimes, int numberIterations,
2243                             int numberFixed, bool ifInfeasible);
2244    /// Return strong info
2245    inline const int * strongInfo() const {
2246        return strongInfo_;
2247    }
2248
2249    /// Return mutable strong info
2250    inline int * mutableStrongInfo() {
2251        return strongInfo_;
2252    }
2253    /// Get stored row cuts for donor/recipient CbcModel
2254    CglStored * storedRowCuts() const {
2255        return storedRowCuts_;
2256    }
2257    /// Set stored row cuts for donor/recipient CbcModel
2258    void setStoredRowCuts(CglStored * cuts) {
2259        storedRowCuts_ = cuts;
2260    }
2261    /// Says whether all dynamic integers
2262    inline bool allDynamic () const {
2263        return ((ownership_&0x40000000) != 0) ;
2264    }
2265    /// Create C++ lines to get to current state
2266    void generateCpp( FILE * fp, int options);
2267    /// Generate an OsiBranchingInformation object
2268    OsiBranchingInformation usefulInformation() const;
2269    /** Warm start object produced by heuristic or strong branching
2270
2271        If get a valid integer solution outside branch and bound then it can take
2272        a reasonable time to solve LP which produces clean solution.  If this object has
2273        any size then it will be used in solve.
2274    */
2275    inline void setBestSolutionBasis(const CoinWarmStartBasis & bestSolutionBasis) {
2276        bestSolutionBasis_ = bestSolutionBasis;
2277    }
2278    /// Redo walkback arrays
2279    void redoWalkBack();
2280    //@}
2281
2282//---------------------------------------------------------------------------
2283
2284private:
2285    ///@name Private member data
2286    //@{
2287
2288    /// The solver associated with this model.
2289    OsiSolverInterface * solver_;
2290
2291    /** Ownership of objects and other stuff
2292
2293        0x80000000 model owns solver
2294        0x40000000 all variables CbcDynamicPseudoCost
2295    */
2296    unsigned int ownership_ ;
2297
2298    /// A copy of the solver, taken at the continuous (root) node.
2299    OsiSolverInterface * continuousSolver_;
2300
2301    /// A copy of the solver, taken at constructor or by saveReferenceSolver
2302    OsiSolverInterface * referenceSolver_;
2303
2304    /// Message handler
2305    CoinMessageHandler * handler_;
2306
2307    /** Flag to say if handler_ is the default handler.
2308
2309      The default handler is deleted when the model is deleted. Other
2310      handlers (supplied by the client) will not be deleted.
2311    */
2312    bool defaultHandler_;
2313
2314    /// Cbc messages
2315    CoinMessages messages_;
2316
2317    /// Array for integer parameters
2318    int intParam_[CbcLastIntParam];
2319
2320    /// Array for double parameters
2321    double dblParam_[CbcLastDblParam];
2322
2323    /** Pointer to an empty warm start object
2324
2325      It turns out to be useful to have this available as a base from
2326      which to build custom warm start objects. This is typed as CoinWarmStart
2327      rather than CoinWarmStartBasis to allow for the possibility that a
2328      client might want to apply a solver that doesn't use a basis-based warm
2329      start. See getEmptyBasis for an example of how this field can be used.
2330    */
2331    mutable CoinWarmStart *emptyWarmStart_ ;
2332
2333    /// Best objective
2334    double bestObjective_;
2335    /// Best possible objective
2336    double bestPossibleObjective_;
2337    /// Sum of Changes to objective by first solve
2338    double sumChangeObjective1_;
2339    /// Sum of Changes to objective by subsequent solves
2340    double sumChangeObjective2_;
2341
2342    /// Array holding the incumbent (best) solution.
2343    double * bestSolution_;
2344    /// Arrays holding other solutions.
2345    double ** savedSolutions_;
2346
2347    /** Array holding the current solution.
2348
2349      This array is used more as a temporary.
2350    */
2351    double * currentSolution_;
2352    /** For testing infeasibilities - will point to
2353        currentSolution_ or solver-->getColSolution()
2354    */
2355    mutable const double * testSolution_;
2356    /** Warm start object produced by heuristic or strong branching
2357
2358        If get a valid integer solution outside branch and bound then it can take
2359        a reasonable time to solve LP which produces clean solution.  If this object has
2360        any size then it will be used in solve.
2361    */
2362    CoinWarmStartBasis bestSolutionBasis_ ;
2363    /// Global cuts
2364    OsiCuts globalCuts_;
2365
2366    /// Minimum degradation in objective value to continue cut generation
2367    double minimumDrop_;
2368    /// Number of solutions
2369    int numberSolutions_;
2370    /// Number of saved solutions
2371    int numberSavedSolutions_;
2372    /// Maximum number of saved solutions
2373    int maximumSavedSolutions_;
2374    /** State of search
2375        0 - no solution
2376        1 - only heuristic solutions
2377        2 - branched to a solution
2378        3 - no solution but many nodes
2379    */
2380    int stateOfSearch_;
2381    /// At which depths to do cuts
2382    int whenCuts_;
2383    /// Hotstart solution
2384    double * hotstartSolution_;
2385    /// Hotstart priorities
2386    int * hotstartPriorities_;
2387    /// Number of heuristic solutions
2388    int numberHeuristicSolutions_;
2389    /// Cumulative number of nodes
2390    int numberNodes_;
2391    /** Cumulative number of nodes for statistics.
2392        Must fix to match up
2393    */
2394    int numberNodes2_;
2395    /// Cumulative number of iterations
2396    int numberIterations_;
2397    /// Cumulative number of solves
2398    int numberSolves_;
2399    /// Status of problem - 0 finished, 1 stopped, 2 difficulties
2400    int status_;
2401    /** Secondary status of problem
2402        -1 unset (status_ will also be -1)
2403        0 search completed with solution
2404        1 linear relaxation not feasible (or worse than cutoff)
2405        2 stopped on gap
2406        3 stopped on nodes
2407        4 stopped on time
2408        5 stopped on user event
2409        6 stopped on solutions
2410     */
2411    int secondaryStatus_;
2412    /// Number of integers in problem
2413    int numberIntegers_;
2414    /// Number of rows at continuous
2415    int numberRowsAtContinuous_;
2416    /// Maximum number of cuts
2417    int maximumNumberCuts_;
2418    /** Current phase (so heuristics etc etc can find out).
2419        0 - initial solve
2420        1 - solve with cuts at root
2421        2 - solve with cuts
2422        3 - other e.g. strong branching
2423        4 - trying to validate a solution
2424        5 - at end of search
2425    */
2426    int phase_;
2427
2428    /// Number of entries in #addedCuts_
2429    int currentNumberCuts_;
2430
2431    /** Current limit on search tree depth
2432
2433      The allocated size of #walkback_. Increased as needed.
2434    */
2435    int maximumDepth_;
2436    /** Array used to assemble the path between a node and the search tree root
2437
2438      The array is resized when necessary. #maximumDepth_  is the current
2439      allocated size.
2440    */
2441    CbcNodeInfo ** walkback_;
2442    CbcNodeInfo ** lastNodeInfo_;
2443    const OsiRowCut ** lastCut_;
2444    int lastDepth_;
2445    int lastNumberCuts2_;
2446    int maximumCuts_;
2447    int * lastNumberCuts_;
2448
2449    /** The list of cuts initially collected for this subproblem
2450
2451      When the subproblem at this node is rebuilt, a set of cuts is collected
2452      for inclusion in the constraint system. If any of these cuts are
2453      subsequently removed because they have become loose, the corresponding
2454      entry is set to NULL.
2455    */
2456    CbcCountRowCut ** addedCuts_;
2457
2458    /** A pointer to a row cut which will be added instead of normal branching.
2459        After use it should be set to NULL.
2460    */
2461    OsiRowCut * nextRowCut_;
2462
2463    /// Current node so can be used elsewhere
2464    CbcNode * currentNode_;
2465
2466    /// Indices of integer variables
2467    int * integerVariable_;
2468    /// Whether of not integer
2469    char * integerInfo_;
2470    /// Holds solution at continuous (after cuts)
2471    double * continuousSolution_;
2472    /// Array marked whenever a solution is found if non-zero
2473    int * usedInSolution_;
2474    /**
2475        Special options
2476        0 bit (1) - check if cuts valid (if on debugger list)
2477        1 bit (2) - use current basis to check integer solution (rather than all slack)
2478        2 bit (4) - don't check integer solution (by solving LP)
2479        3 bit (8) - fast analyze
2480        4 bit (16) - non-linear model - so no well defined CoinPackedMatrix
2481        5 bit (32) - keep names
2482        6 bit (64) - try for dominated columns
2483        7 bit (128) - SOS type 1 but all declared integer
2484        8 bit (256) - Set to say solution just found, unset by doing cuts
2485        9 bit (512) - Try reduced model after 100 nodes
2486        10 bit (1024) - Switch on some heuristics even if seems unlikely
2487        11 bit (2048) - Mark as in small branch and bound
2488        12 bit (4096) - Funny cuts so do slow way (in some places)
2489        13 bit (8192) - Funny cuts so do slow way (in other places)
2490        14 bit (16384) - Use Cplex! for fathoming
2491        15 bit (32768) - Try reduced model after 0 nodes
2492        16 bit (65536) - Original model had integer bounds
2493        17 bit (131072) - Perturbation switched off
2494        18 bit (262144) - donor CbcModel
2495        19 bit (524288) - recipient CbcModel
2496    */
2497    int specialOptions_;
2498    /** More special options
2499        at present bottom 6 bits used for shadow price mode
2500        1024 for experimental hotstart
2501        2048,4096 breaking out of cuts
2502        8192 slowly increase minimum drop
2503        16384 gomory
2504        32768 more heuristics in sub trees
2505        65536 no cuts in preprocessing
2506        131072 Time limits elapsed
2507        18 bit (262144) - Perturb fathom nodes
2508        19 bit (524288) - No limit on fathom nodes
2509        20 bit (1048576) - Reduce sum of infeasibilities before cuts
2510        21 bit (2097152) - Reduce sum of infeasibilities after cuts
2511    */
2512    int moreSpecialOptions_;
2513    /// User node comparison function
2514    CbcCompareBase * nodeCompare_;
2515    /// User feasibility function (see CbcFeasibleBase.hpp)
2516    CbcFeasibilityBase * problemFeasibility_;
2517    /// Tree
2518    CbcTree * tree_;
2519    /// A pointer to model to be used for subtrees
2520    CbcModel * subTreeModel_;
2521    /// Number of times any subtree stopped on nodes, time etc
2522    int numberStoppedSubTrees_;
2523    /// Variable selection function
2524    CbcBranchDecision * branchingMethod_;
2525    /// Cut modifier function
2526    CbcCutModifier * cutModifier_;
2527    /// Strategy
2528    CbcStrategy * strategy_;
2529    /// Parent model
2530    CbcModel * parentModel_;
2531    /** Whether to automatically do presolve before branch and bound.
2532        0 - no
2533        1 - ordinary presolve
2534        2 - integer presolve (dodgy)
2535    */
2536    /// Pointer to array[getNumCols()] (for speed) of column lower bounds
2537    const double * cbcColLower_;
2538    /// Pointer to array[getNumCols()] (for speed) of column upper bounds
2539    const double * cbcColUpper_;
2540    /// Pointer to array[getNumRows()] (for speed) of row lower bounds
2541    const double * cbcRowLower_;
2542    /// Pointer to array[getNumRows()] (for speed) of row upper bounds
2543    const double * cbcRowUpper_;
2544    /// Pointer to array[getNumCols()] (for speed) of primal solution vector
2545    const double * cbcColSolution_;
2546    /// Pointer to array[getNumRows()] (for speed) of dual prices
2547    const double * cbcRowPrice_;
2548    /// Get a pointer to array[getNumCols()] (for speed) of reduced costs
2549    const double * cbcReducedCost_;
2550    /// Pointer to array[getNumRows()] (for speed) of row activity levels.
2551    const double * cbcRowActivity_;
2552    /// Pointer to user-defined data structure
2553    void * appData_;
2554    /// Presolve for CbcTreeLocal
2555    int presolve_;
2556    /** Maximum number of candidates to consider for strong branching.
2557      To disable strong branching, set this to 0.
2558    */
2559    int numberStrong_;
2560    /** \brief The number of branches before pseudo costs believed
2561           in dynamic strong branching.
2562
2563      A value of 0 is  off.
2564    */
2565    int numberBeforeTrust_;
2566    /** \brief The number of variables for which to compute penalties
2567           in dynamic strong branching.
2568    */
2569    int numberPenalties_;
2570    /// For threads - stop after this many "iterations"
2571    int stopNumberIterations_;
2572    /** Scale factor to make penalties match strong.
2573        Should/will be computed */
2574    double penaltyScaleFactor_;
2575    /// Number of analyze iterations to do
2576    int numberAnalyzeIterations_;
2577    /// Arrays with analysis results
2578    double * analyzeResults_;
2579    /// Number of nodes infeasible by normal branching (before cuts)
2580    int numberInfeasibleNodes_;
2581    /** Problem type as set by user or found by analysis.  This will be extended
2582        0 - not known
2583        1 - Set partitioning <=
2584        2 - Set partitioning ==
2585        3 - Set covering
2586    */
2587    int problemType_;
2588    /// Print frequency
2589    int printFrequency_;
2590    /// Number of cut generators
2591    int numberCutGenerators_;
2592    // Cut generators
2593    CbcCutGenerator ** generator_;
2594    // Cut generators before any changes
2595    CbcCutGenerator ** virginGenerator_;
2596    /// Number of heuristics
2597    int numberHeuristics_;
2598    /// Heuristic solvers
2599    CbcHeuristic ** heuristic_;
2600    /// Pointer to heuristic solver which found last solution (or NULL)
2601    CbcHeuristic * lastHeuristic_;
2602    /// Depth for fast nodes
2603    int fastNodeDepth_;
2604    /*! Pointer to the event handler */
2605# ifdef CBC_ONLY_CLP
2606    ClpEventHandler *eventHandler_ ;
2607# else
2608    CbcEventHandler *eventHandler_ ;
2609# endif
2610
2611    /// Total number of objects
2612    int numberObjects_;
2613
2614    /** \brief Integer and Clique and ... information
2615
2616      \note The code assumes that the first objects on the list will be
2617        SimpleInteger objects for each integer variable, followed by
2618        Clique objects. Portions of the code that understand Clique objects
2619        will fail if they do not immediately follow the SimpleIntegers.
2620        Large chunks of the code will fail if the first objects are not
2621        SimpleInteger. As of 2003.08, SimpleIntegers and Cliques are the only
2622        objects.
2623    */
2624    OsiObject ** object_;
2625    /// Now we may not own objects - just point to solver's objects
2626    bool ownObjects_;
2627
2628    /// Original columns as created by integerPresolve or preprocessing
2629    int * originalColumns_;
2630    /// How often to scan global cuts
2631    int howOftenGlobalScan_;
2632    /** Number of times global cuts violated.  When global cut pool then this
2633        should be kept for each cut and type of cut */
2634    int numberGlobalViolations_;
2635    /// Number of extra iterations in fast lp
2636    int numberExtraIterations_;
2637    /// Number of extra nodes in fast lp
2638    int numberExtraNodes_;
2639    /** Value of objective at continuous
2640        (Well actually after initial round of cuts)
2641    */
2642    double continuousObjective_;
2643    /** Value of objective before root node cuts added
2644    */
2645    double originalContinuousObjective_;
2646    /// Number of infeasibilities at continuous
2647    int continuousInfeasibilities_;
2648    /// Maximum number of cut passes at root
2649    int maximumCutPassesAtRoot_;
2650    /// Maximum number of cut passes
2651    int maximumCutPasses_;
2652    /// Preferred way of branching
2653    int preferredWay_;
2654    /// Current cut pass number
2655    int currentPassNumber_;
2656    /// Maximum number of cuts (for whichGenerator_)
2657    int maximumWhich_;
2658    /// Maximum number of rows
2659    int maximumRows_;
2660    /// Random seed
2661    int randomSeed_;
2662    /// Current depth
2663    int currentDepth_;
2664    /// Thread specific random number generator
2665    mutable CoinThreadRandom randomNumberGenerator_;
2666    /// Work basis for temporary use
2667    CoinWarmStartBasis workingBasis_;
2668    /// Which cut generator generated this cut
2669    int * whichGenerator_;
2670    /// Maximum number of statistics
2671    int maximumStatistics_;
2672    /// statistics
2673    CbcStatistics ** statistics_;
2674    /// Maximum depth reached
2675    int maximumDepthActual_;
2676    /// Number of reduced cost fixings
2677    double numberDJFixed_;
2678    /// Probing info
2679    CglTreeProbingInfo * probingInfo_;
2680    /// Number of fixed by analyze at root
2681    int numberFixedAtRoot_;
2682    /// Number fixed by analyze so far
2683    int numberFixedNow_;
2684    /// Whether stopping on gap
2685    bool stoppedOnGap_;
2686    /// Whether event happened
2687    mutable bool eventHappened_;
2688    /// Number of long strong goes
2689    int numberLongStrong_;
2690    /// Number of old active cuts
2691    int numberOldActiveCuts_;
2692    /// Number of new cuts
2693    int numberNewCuts_;
2694    /// Strategy worked out - mainly at root node
2695    int searchStrategy_;
2696    /// Number of iterations in strong branching
2697    int numberStrongIterations_;
2698    /** 0 - number times strong branching done, 1 - number fixed, 2 - number infeasible
2699        Second group of three is a snapshot at node [6] */
2700    int strongInfo_[7];
2701    /**
2702        For advanced applications you may wish to modify the behavior of Cbc
2703        e.g. if the solver is a NLP solver then you may not have an exact
2704        optimum solution at each step.  This gives characteristics - just for one BAB.
2705        For actually saving/restoring a solution you need the actual solver one.
2706    */
2707    OsiBabSolver * solverCharacteristics_;
2708    /// Whether to force a resolve after takeOffCuts
2709    bool resolveAfterTakeOffCuts_;
2710    /// Maximum number of iterations (designed to be used in heuristics)
2711    int maximumNumberIterations_;
2712    /// Anything with priority >= this can be treated as continuous
2713    int continuousPriority_;
2714    /// Number of outstanding update information items
2715    int numberUpdateItems_;
2716    /// Maximum number of outstanding update information items
2717    int maximumNumberUpdateItems_;
2718    /// Update items
2719    CbcObjectUpdateData * updateItems_;
2720    /// Stored row cuts for donor/recipient CbcModel
2721    CglStored * storedRowCuts_;
2722    /**
2723       Parallel
2724       0 - off
2725       1 - testing
2726       2-99 threads
2727       other special meanings
2728    */
2729    int numberThreads_;
2730    /** thread mode
2731        always use numberThreads for branching
2732        1 set then deterministic
2733        2 set then use numberThreads for root cuts
2734        4 set then use numberThreads in root mini branch and bound
2735        default is 0
2736    */
2737    int threadMode_;
2738    /// Thread stuff for master
2739    CbcBaseModel * master_;
2740    /// Pointer to masterthread
2741    CbcThread * masterThread_;
2742//@}
2743};
2744/// So we can use osiObject or CbcObject during transition
2745void getIntegerInformation(const OsiObject * object, double & originalLower,
2746                           double & originalUpper) ;
2747// So we can call from other programs
2748// Real main program
2749class OsiClpSolverInterface;
2750int CbcMain (int argc, const char *argv[], OsiClpSolverInterface & solver, CbcModel ** babSolver);
2751int CbcMain (int argc, const char *argv[], CbcModel & babSolver);
2752// four ways of calling
2753int callCbc(const char * input2, OsiClpSolverInterface& solver1);
2754int callCbc(const char * input2);
2755int callCbc(const std::string input2, OsiClpSolverInterface& solver1);
2756int callCbc(const std::string input2) ;
2757// When we want to load up CbcModel with options first
2758void CbcMain0 (CbcModel & babSolver);
2759int CbcMain1 (int argc, const char *argv[], CbcModel & babSolver);
2760// two ways of calling
2761int callCbc(const char * input2, CbcModel & babSolver);
2762int callCbc(const std::string input2, CbcModel & babSolver);
2763// And when CbcMain0 already called to initialize
2764int callCbc1(const char * input2, CbcModel & babSolver);
2765int callCbc1(const std::string input2, CbcModel & babSolver);
2766// And when CbcMain0 already called to initialize (with call back) (see CbcMain1 for whereFrom)
2767int callCbc1(const char * input2, CbcModel & babSolver, int (CbcModel * currentSolver, int whereFrom));
2768int callCbc1(const std::string input2, CbcModel & babSolver, int (CbcModel * currentSolver, int whereFrom));
2769int CbcMain1 (int argc, const char *argv[], CbcModel & babSolver, int (CbcModel * currentSolver, int whereFrom));
2770// For uniform setting of cut and heuristic options
2771void setCutAndHeuristicOptions(CbcModel & model);
2772#endif
2773
Note: See TracBrowser for help on using the repository browser.