source: stable/2.7/Cbc/src/CbcModel.hpp @ 1724

Last change on this file since 1724 was 1724, checked in by forrest, 8 years ago

more control over message handling in mini bab

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