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

Last change on this file since 747 was 747, checked in by forrest, 12 years ago

max times and fix bug in fpump

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 73.7 KB
Line 
1// Copyright (C) 2002, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#ifndef CbcModel_H
4#define CbcModel_H
5#include <string>
6#include <vector>
7#include "CoinFinite.hpp"
8#include "CoinMessageHandler.hpp"
9#include "OsiSolverInterface.hpp"
10#include "OsiBranchingObject.hpp"
11#include "OsiCuts.hpp"
12#include "CoinWarmStartBasis.hpp"
13#include "CbcCompareBase.hpp"
14#include "CbcMessage.hpp"
15
16//class OsiSolverInterface;
17
18class CbcCutGenerator;
19class OsiRowCut;
20class OsiBabSolver;
21class OsiRowCutDebugger;
22class CglCutGenerator;
23class CbcCutModifier;
24class CglTreeProbingInfo;
25class CbcHeuristic;
26class OsiObject;
27class CbcTree;
28class CbcStrategy;
29class CbcFeasibilityBase;
30class CbcStatistics;
31class CbcEventHandler ;
32class CglPreProcess;
33
34// #define CBC_CHECK_BASIS 1
35
36//#############################################################################
37
38/** Simple Branch and bound class
39
40  The initialSolve() method solves the initial LP relaxation of the MIP
41  problem. The branchAndBound() method can then be called to finish using
42  a branch and cut algorithm.
43
44  <h3>Search Tree Traversal</h3>
45
46  Subproblems (aka nodes) requiring additional evaluation are stored using
47  the CbcNode and CbcNodeInfo objects. Ancestry linkage is maintained in the
48  CbcNodeInfo object. Evaluation of a subproblem within branchAndBound()
49  proceeds as follows:
50  <ul>
51    <li> The node representing the most promising parent subproblem is popped
52         from the heap which holds the set of subproblems requiring further
53         evaluation.
54    <li> Using branching instructions stored in the node, and information in
55         its ancestors, the model and solver are adjusted to create the
56         active subproblem.
57    <li> If the parent subproblem will require further evaluation
58         (<i>i.e.</i>, there are branches remaining) its node is pushed back
59         on the heap. Otherwise, the node is deleted.  This may trigger
60         recursive deletion of ancestors.
61    <li> The newly created subproblem is evaluated.
62    <li> If the subproblem requires further evaluation, a node is created.
63         All information needed to recreate the subproblem (branching
64         information, row and column cuts) is placed in the node and the node
65         is added to the set of subproblems awaiting further evaluation.
66  </ul>
67  Note that there is never a node representing the active subproblem; the model
68  and solver represent the active subproblem.
69
70  <h3>Row (Constraint) Cut Handling</h3>
71
72  For a typical subproblem, the sequence of events is as follows:
73  <ul>
74    <li> The subproblem is rebuilt for further evaluation: One result of a
75         call to addCuts() is a traversal of ancestors, leaving a list of all
76         cuts used in the ancestors in #addedCuts_. This list is then scanned
77         to construct a basis that includes only tight cuts. Entries for
78         loose cuts are set to NULL.
79    <li> The subproblem is evaluated: One result of a call to solveWithCuts()
80         is the return of a set of newly generated cuts for the subproblem.
81         #addedCuts_ is also kept up-to-date as old cuts become loose.
82    <li> The subproblem is stored for further processing: A call to
83         CbcNodeInfo::addCuts() adds the newly generated cuts to the
84         CbcNodeInfo object associated with this node.
85  </ul>
86  See CbcCountRowCut for details of the bookkeeping associated with cut
87  management.
88*/
89
90class CbcModel  {
91 
92public:
93
94enum CbcIntParam {
95  /** The maximum number of nodes before terminating */
96  CbcMaxNumNode=0,
97  /** The maximum number of solutions before terminating */
98  CbcMaxNumSol,
99  /** Fathoming discipline
100
101    Controls objective function comparisons for purposes of fathoming by bound
102    or determining monotonic variables.
103
104    If 1, action is taken only when the current objective is strictly worse
105    than the target. Implementation is handled by adding a small tolerance to
106    the target.
107  */
108  CbcFathomDiscipline,
109  /** Adjusts printout
110      1 does different node message with number unsatisfied on last branch
111  */
112  CbcPrinting,
113  /** Just a marker, so that a static sized array can store parameters. */
114  CbcLastIntParam
115};
116
117enum CbcDblParam {
118  /** The maximum amount the value of an integer variable can vary from
119      integer and still be considered feasible. */
120  CbcIntegerTolerance=0,
121  /** The objective is assumed to worsen by this amount for each
122      integer infeasibility. */
123  CbcInfeasibilityWeight,
124  /** The amount by which to tighten the objective function cutoff when
125      a new solution is discovered. */
126  CbcCutoffIncrement,
127  /** Stop when the gap between the objective value of the best known solution
128    and the best bound on the objective of any solution is less than this.
129 
130    This is an absolute value. Conversion from a percentage is left to the
131    client.
132  */
133  CbcAllowableGap,
134  /** Stop when the gap between the objective value of the best known solution
135    and the best bound on the objective of any solution is less than this
136    fraction of of the absolute value of best known solution.
137 
138    Code stops if either this test or CbcAllowableGap test succeeds
139  */
140  CbcAllowableFractionGap,
141  /** \brief The maximum number of seconds before terminating.
142             A double should be adequate! */
143  CbcMaximumSeconds,
144  /// Cutoff - stored for speed
145  CbcCurrentCutoff,
146  /// Optimization direction - stored for speed
147  CbcOptimizationDirection,
148  /// Current objective value
149  CbcCurrentObjectiveValue,
150  /// Current minimization objective value
151  CbcCurrentMinimizationObjectiveValue,
152  /** \brief The time at start of model.
153             So that other pieces of code can access */
154  CbcStartSeconds,
155  /** Just a marker, so that a static sized array can store parameters. */
156  CbcLastDblParam
157};
158
159  //---------------------------------------------------------------------------
160
161public:
162  ///@name Solve methods
163  //@{
164    /** \brief Solve the initial LP relaxation
165
166      Invoke the solver's %initialSolve() method.
167    */
168    void initialSolve(); 
169
170    /** \brief Invoke the branch \& cut algorithm
171
172      The method assumes that initialSolve() has been called to solve the
173      LP relaxation. It processes the root node, then proceeds to explore the
174      branch & cut search tree. The search ends when the tree is exhausted or
175      one of several execution limits is reached.
176      If doStatistics is 1 summary statistics are printed
177      if 2 then also the path to best solution (if found by branching)
178      if 3 then also one line per node
179    */
180     void branchAndBound(int doStatistics=0);
181
182    /** \brief create a clean model from partially fixed problem
183
184      The method creates a new model with given bounds and with no tree.
185    */
186     CbcModel *  cleanModel(const double * lower, const double * upper);
187    /** \brief Invoke the branch \& cut algorithm on partially fixed problem
188
189      The method presolves the given model and does branch and cut. The search
190      ends when the tree is exhausted or maximum nodes is reached.
191
192      If better solution found then it is saved.
193
194      Returns 0 if search completed and solution, 1 if not completed and solution,
195      2 if completed and no solution, 3 if not completed and no solution.
196
197      Normally okay to do cleanModel immediately followed by subBranchandBound
198      (== other form of subBranchAndBound)
199      but may need to get at model for advanced features.
200
201      Deletes model2
202    */
203     int subBranchAndBound(CbcModel * model2,
204                           CbcModel * presolvedModel,
205                           int maximumNodes);
206    /** \brief Invoke the branch \& cut algorithm on partially fixed problem
207
208      The method creates a new model with given bounds, presolves it
209      then proceeds to explore the branch & cut search tree. The search
210      ends when the tree is exhausted or maximum nodes is reached.
211
212      If better solution found then it is saved.
213
214      Returns 0 if search completed and solution, 1 if not completed and solution,
215      2 if completed and no solution, 3 if not completed and no solution.
216
217      This is just subModel immediately followed by other version of
218      subBranchandBound.
219
220    */
221     int subBranchAndBound(const double * lower, const double * upper,
222                            int maximumNodes);
223
224    /** \brief Process root node and return a strengthened model
225
226      The method assumes that initialSolve() has been called to solve the
227      LP relaxation. It processes the root node and then returns a pointer
228      to the strengthened model (or NULL if infeasible)
229    */
230     OsiSolverInterface *  strengthenedModel();
231  /** preProcess problem - replacing solver
232      If makeEquality true then <= cliques converted to ==.
233      Presolve will be done numberPasses times.
234
235      Returns NULL if infeasible
236
237      If makeEquality is 1 add slacks to get cliques,
238      if 2 add slacks to get sos (but only if looks plausible) and keep sos info
239  */
240  CglPreProcess * preProcess( int makeEquality=0, int numberPasses=5,
241                  int tuning=5);
242  /** Does postprocessing - original solver back.
243      User has to delete process */
244  void postProcess(CglPreProcess * process);
245private:
246    /** \brief Evaluate a subproblem using cutting planes and heuristics
247
248      The method invokes a main loop which generates cuts, applies heuristics,
249      and reoptimises using the solver's native %resolve() method.
250      It returns true if the subproblem remains feasible at the end of the
251      evaluation.
252    */
253  bool solveWithCuts(OsiCuts & cuts, int numberTries,CbcNode * node);
254  /** Input one node output N nodes to put on tree and optional solution update
255      This should be able to operate in parallel so is given a solver and is const(ish)
256      However we will need to keep an array of solver_ and bases and more
257      status is 0 for normal, 1 if solution
258      Calling code should always push nodes back on tree
259  */
260  CbcNode ** solveOneNode(int whichSolver,CbcNode * node, 
261                          int & numberNodesOutput, int & status) ;
262  /// Update size of whichGenerator
263  void resizeWhichGenerator(int numberNow, int numberAfter);
264public:
265#ifndef CBC_THREAD
266#define NEW_UPDATE_OBJECT 0
267#else
268#define NEW_UPDATE_OBJECT 2
269#endif
270#if NEW_UPDATE_OBJECT>1
271  /// Adds an update information object
272  void addUpdateInformation(const CbcObjectUpdateData & data);
273#endif
274  /** Do one node - broken out for clarity?
275      also for parallel (when baseModel!=this)
276      Returns 1 if solution found
277      node NULL on return if no branches left
278      newNode NULL if no new node created
279  */
280  int doOneNode(CbcModel * baseModel, CbcNode * & node, CbcNode * & newNode);
281
282  /// Returns true if locked
283  bool isLocked() const;
284#ifdef CBC_THREAD
285  /**
286     Locks a thread if parallel so that stuff like cut pool
287     can be updated and/or used.
288  */
289  void lockThread();
290  /**
291     Unlocks a thread if parallel to say cut pool stuff not needed
292  */
293  void unlockThread();
294#else
295  inline void lockThread() {}
296  inline void unlockThread() {}
297#endif
298private:
299  /** Move/copy information from one model to another
300      -1 - initialization
301      0 - from base model
302      1 - to base model (and reset)
303      2 - add in final statistics etc (and reset so can do clean destruction)
304  */
305  void moveToModel(CbcModel * baseModel,int mode);
306public:
307    /** \brief Reoptimise an LP relaxation
308   
309      Invoke the solver's %resolve() method.
310      whereFrom -
311      0 - initial continuous
312      1 - resolve on branch (before new cuts)
313      2 - after new cuts
314      3  - obsolete code or something modified problem in unexpected way
315      10 - after strong branching has fixed variables at root
316      11 - after strong branching has fixed variables in tree
317
318      returns 1 feasible, 0 infeasible, -1 feasible but skip cuts
319    */
320    int resolve(CbcNodeInfo * parent, int whereFrom);
321    /// Make given rows (L or G) into global cuts and remove from lp
322    void makeGlobalCuts(int numberRows,const int * which); 
323    /// Make given cut into a global cut
324    void makeGlobalCut(const OsiRowCut * cut); 
325    /// Make given cut into a global cut
326    void makeGlobalCut(const OsiRowCut & cut); 
327  //@}
328
329  /** \name Presolve methods */
330  //@{
331
332  /** Identify cliques and construct corresponding objects.
333
334      Find cliques with size in the range
335      [\p atLeastThisMany, \p lessThanThis] and construct corresponding
336      CbcClique objects.
337      If \p makeEquality is true then a new model may be returned if
338      modifications had to be made, otherwise \c this is returned.
339      If the problem is infeasible #numberObjects_ is set to -1.
340      A client must use deleteObjects() before a second call to findCliques().
341      If priorities exist, clique priority is set to the default.
342  */
343  CbcModel * findCliques(bool makeEquality, int atLeastThisMany,
344                         int lessThanThis, int defaultValue=1000);
345
346  /** Do integer presolve, creating a new (presolved) model.
347
348    Returns the new model, or NULL if feasibility is lost.
349    If weak is true then just does a normal presolve
350 
351    \todo It remains to work out the cleanest way of getting a solution to
352          the original problem at the end. So this is very preliminary.
353   */
354  CbcModel * integerPresolve(bool weak=false);
355
356  /** Do integer presolve, modifying the current model.
357
358      Returns true if the model remains feasible after presolve.
359  */
360  bool integerPresolveThisModel(OsiSolverInterface * originalSolver,bool weak=false);
361
362
363  /// Put back information into the original model after integer presolve.
364  void originalModel(CbcModel * presolvedModel,bool weak);
365
366  /** \brief For variables involved in VUB constraints, see if we can tighten
367             bounds by solving lp's
368
369      Returns false if feasibility is lost.
370      If CglProbing is available, it will be tried as well to see if it can
371      tighten bounds.
372      This routine is just a front end for tightenVubs(int,const int*,double).
373
374      If <tt>type = -1</tt> all variables are processed (could be very slow).
375      If <tt>type = 0</tt> only variables involved in VUBs are processed.
376      If <tt>type = n > 0</tt>, only the n most expensive VUB variables
377      are processed, where it is assumed that x is at its maximum so delta
378      would have to go to 1 (if x not at bound).
379
380      If \p allowMultipleBinary is true, then a VUB constraint is a row with
381      one continuous variable and any number of binary variables.
382
383      If <tt>useCutoff < 1.0e30</tt>, the original objective is installed as a
384      constraint with \p useCutoff as a bound.
385  */
386  bool tightenVubs(int type,bool allowMultipleBinary=false,
387                   double useCutoff=1.0e50);
388 
389  /** \brief For variables involved in VUB constraints, see if we can tighten
390             bounds by solving lp's
391
392    This version is just handed a list of variables to be processed.
393  */
394  bool tightenVubs(int numberVubs, const int * which,
395                   double useCutoff=1.0e50);
396  /**
397    Analyze problem to find a minimum change in the objective function.
398  */
399  void analyzeObjective();
400
401
402  //@}
403
404  /** \name Object manipulation routines
405 
406    See OsiObject for an explanation of `object' in the context of CbcModel.
407  */
408  //@{
409
410  /// Get the number of objects
411  inline int numberObjects() const { return numberObjects_;}
412  /// Set the number of objects
413  inline void setNumberObjects(int number) 
414  {  numberObjects_=number;}
415
416  /// Get the array of objects
417  inline OsiObject ** objects() const { return object_;}
418
419  /// Get the specified object
420  const inline OsiObject * object(int which) const { return object_[which];}
421  /// Get the specified object
422  inline OsiObject * modifiableObject(int which) const { return object_[which];}
423
424  /// Delete all object information (and just back to integers if true)
425  void deleteObjects(bool findIntegers=true);
426
427  /** Add in object information.
428 
429    Objects are cloned; the owner can delete the originals.
430  */
431  void addObjects(int numberObjects, OsiObject ** objects);
432
433  /** Add in object information.
434 
435    Objects are cloned; the owner can delete the originals.
436  */
437  void addObjects(int numberObjects, CbcObject ** objects);
438
439  /// Ensure attached objects point to this model.
440  void synchronizeModel() ;
441
442  /** \brief Identify integer variables and create corresponding objects.
443 
444    Record integer variables and create an CbcSimpleInteger object for each
445    one.
446    If \p startAgain is true, a new scan is forced, overwriting any existing
447    integer variable information.
448    If type > 0 then 1==PseudoCost
449  */
450
451  void findIntegers(bool startAgain,int type=0);
452
453  //@}
454
455  //---------------------------------------------------------------------------
456
457  /**@name Parameter set/get methods
458
459     The set methods return true if the parameter was set to the given value,
460     false if the value of the parameter is out of range.
461
462     The get methods return the value of the parameter.
463
464  */
465  //@{
466  /// Set an integer parameter
467  inline bool setIntParam(CbcIntParam key, int value) {
468    intParam_[key] = value;
469    return true;
470  }
471  /// Set a double parameter
472  inline bool setDblParam(CbcDblParam key, double value) {
473    dblParam_[key] = value;
474    return true;
475  }
476  /// Get an integer parameter
477  inline int getIntParam(CbcIntParam key) const {
478    return intParam_[key];
479  }
480  /// Get a double parameter
481  inline double getDblParam(CbcDblParam key) const {
482    return dblParam_[key];
483  }
484  /*! \brief Set cutoff bound on the objective function.
485
486    When using strict comparison, the bound is adjusted by a tolerance to
487    avoid accidentally cutting off the optimal solution.
488  */
489  void setCutoff(double value) ;
490
491  /// Get the cutoff bound on the objective function - always as minimize
492  inline double getCutoff() const
493  { //double value ;
494    //solver_->getDblParam(OsiDualObjectiveLimit,value) ;
495    //assert( dblParam_[CbcCurrentCutoff]== value * solver_->getObjSense());
496    return dblParam_[CbcCurrentCutoff];
497  }
498
499  /// Set the \link CbcModel::CbcMaxNumNode maximum node limit \endlink
500  inline bool setMaximumNodes( int value)
501  { return setIntParam(CbcMaxNumNode,value); }
502
503  /// Get the \link CbcModel::CbcMaxNumNode maximum node limit \endlink
504  inline int getMaximumNodes() const
505  { return getIntParam(CbcMaxNumNode); }
506
507  /** Set the
508      \link CbcModel::CbcMaxNumSol maximum number of solutions \endlink
509      desired.
510  */
511  inline bool setMaximumSolutions( int value) {
512    return setIntParam(CbcMaxNumSol,value);
513  }
514  /** Get the
515      \link CbcModel::CbcMaxNumSol maximum number of solutions \endlink
516      desired.
517  */
518  inline int getMaximumSolutions() const {
519    return getIntParam(CbcMaxNumSol);
520  }
521  /// Set the printing mode
522  inline bool setPrintingMode( int value)
523  { return setIntParam(CbcPrinting,value); }
524
525  /// Get the printing mode
526  inline int getPrintingMode() const
527  { return getIntParam(CbcPrinting); }
528
529  /** Set the
530      \link CbcModel::CbcMaximumSeconds maximum number of seconds \endlink
531      desired.
532  */
533  inline bool setMaximumSeconds( double value) {
534    return setDblParam(CbcMaximumSeconds,value);
535  }
536  /** Get the
537      \link CbcModel::CbcMaximumSeconds maximum number of seconds \endlink
538      desired.
539  */
540  inline double getMaximumSeconds() const {
541    return getDblParam(CbcMaximumSeconds);
542  }
543  /// Current time since start of branchAndbound
544  double getCurrentSeconds() const ;
545
546  /** Set the
547    \link CbcModel::CbcIntegerTolerance integrality tolerance \endlink
548  */
549  inline bool setIntegerTolerance( double value) {
550    return setDblParam(CbcIntegerTolerance,value);
551  }
552  /** Get the
553    \link CbcModel::CbcIntegerTolerance integrality tolerance \endlink
554  */
555  inline double getIntegerTolerance() const {
556    return getDblParam(CbcIntegerTolerance);
557  }
558
559  /** Set the
560      \link CbcModel::CbcInfeasibilityWeight
561            weight per integer infeasibility \endlink
562  */
563  inline bool setInfeasibilityWeight( double value) {
564    return setDblParam(CbcInfeasibilityWeight,value);
565  }
566  /** Get the
567      \link CbcModel::CbcInfeasibilityWeight
568            weight per integer infeasibility \endlink
569  */
570  inline double getInfeasibilityWeight() const {
571    return getDblParam(CbcInfeasibilityWeight);
572  }
573
574  /** Set the \link CbcModel::CbcAllowableGap allowable gap \endlink
575      between the best known solution and the best possible solution.
576  */
577  inline bool setAllowableGap( double value) {
578    return setDblParam(CbcAllowableGap,value);
579  }
580  /** Get the \link CbcModel::CbcAllowableGap allowable gap \endlink
581      between the best known solution and the best possible solution.
582  */
583  inline double getAllowableGap() const {
584    return getDblParam(CbcAllowableGap);
585  }
586
587  /** Set the \link CbcModel::CbcAllowableFractionGap fraction allowable gap \endlink
588      between the best known solution and the best possible solution.
589  */
590  inline bool setAllowableFractionGap( double value) {
591    return setDblParam(CbcAllowableFractionGap,value);
592  }
593  /** Get the \link CbcModel::CbcAllowableFractionGap fraction allowable gap \endlink
594      between the best known solution and the best possible solution.
595  */
596  inline double getAllowableFractionGap() const {
597    return getDblParam(CbcAllowableFractionGap);
598  }
599  /** Set the \link CbcModel::CbcAllowableFractionGap percentage allowable gap \endlink
600      between the best known solution and the best possible solution.
601  */
602  inline bool setAllowablePercentageGap( double value) {
603    return setDblParam(CbcAllowableFractionGap,value*0.01);
604  }
605  /** Get the \link CbcModel::CbcAllowableFractionGap percentage allowable gap \endlink
606      between the best known solution and the best possible solution.
607  */
608  inline double getAllowablePercentageGap() const {
609    return 100.0*getDblParam(CbcAllowableFractionGap);
610  }
611  /** Set the
612      \link CbcModel::CbcCutoffIncrement  \endlink
613      desired.
614  */
615  inline bool setCutoffIncrement( double value) {
616    return setDblParam(CbcCutoffIncrement,value);
617  }
618  /** Get the
619      \link CbcModel::CbcCutoffIncrement  \endlink
620      desired.
621  */
622  inline double getCutoffIncrement() const {
623    return getDblParam(CbcCutoffIncrement);
624  }
625
626  /** Pass in target solution and optional priorities.
627      If priorities then >0 means only branch if incorrect
628      while <0 means branch even if correct. +1 or -1 are
629      highest priority */
630  void setHotstartSolution(const double * solution, const int * priorities=NULL) ;
631 
632  /// Set the minimum drop to continue cuts
633  inline void setMinimumDrop(double value)
634  {minimumDrop_=value;}
635  /// Get the minimum drop to continue cuts
636  inline double getMinimumDrop() const
637  { return minimumDrop_;}
638
639  /** Set the maximum number of cut passes at root node (default 20)
640      Minimum drop can also be used for fine tuning */
641  inline void setMaximumCutPassesAtRoot(int value)
642  {maximumCutPassesAtRoot_=value;}
643  /** Get the maximum number of cut passes at root node */
644  inline int getMaximumCutPassesAtRoot() const
645  { return maximumCutPassesAtRoot_;}
646
647  /** Set the maximum number of cut passes at other nodes (default 10)
648      Minimum drop can also be used for fine tuning */
649  inline void setMaximumCutPasses(int value)
650  {maximumCutPasses_=value;}
651  /** Get the maximum number of cut passes at other nodes (default 10) */
652  inline int getMaximumCutPasses() const
653  { return maximumCutPasses_;}
654  /** Get current cut pass number in this round of cuts.
655      (1 is first pass) */
656  inline int getCurrentPassNumber() const
657  { return currentPassNumber_;}
658
659  /** Set the maximum number of candidates to be evaluated for strong
660    branching.
661
662    A value of 0 disables strong branching.
663  */
664  void setNumberStrong(int number);
665  /** Get the maximum number of candidates to be evaluated for strong
666    branching.
667  */
668  inline int numberStrong() const
669  { return numberStrong_;}
670  /** Set global preferred way to branch
671      -1 down, +1 up, 0 no preference */
672  inline void setPreferredWay(int value)
673  {preferredWay_=value;}
674  /** Get the preferred way to branch (default 0) */
675  inline int getPreferredWay() const
676  { return preferredWay_;}
677  /** Set size of mini - tree.  If > 1 then does total enumeration of
678      tree given by this best variables to branch on
679  */
680  inline void setSizeMiniTree(int value)
681  { sizeMiniTree_=value;}
682  inline int sizeMiniTree() const
683  { return sizeMiniTree_;}
684
685  /** Set the number of branches before pseudo costs believed
686      in dynamic strong branching.
687
688    A value of 0 disables dynamic strong branching.
689  */
690  void setNumberBeforeTrust(int number);
691  /** get the number of branches before pseudo costs believed
692      in dynamic strong branching. */
693  inline int numberBeforeTrust() const
694  { return numberBeforeTrust_;}
695  /** Set the number of variables for which to compute penalties
696      in dynamic strong branching.
697
698    A value of 0 disables penalties.
699  */
700  void setNumberPenalties(int number);
701  /** get the number of variables for which to compute penalties
702      in dynamic strong branching. */
703  inline int numberPenalties() const
704  { return numberPenalties_;}
705  /// Number of analyze iterations to do
706  inline void setNumberAnalyzeIterations(int number)
707  { numberAnalyzeIterations_=number;}
708  inline int numberAnalyzeIterations() const
709  { return numberAnalyzeIterations_;}
710  /** Get scale factor to make penalties match strong.
711      Should/will be computed */
712  inline double penaltyScaleFactor() const
713  { return penaltyScaleFactor_;}
714  /** Set scale factor to make penalties match strong.
715      Should/will be computed */
716  void setPenaltyScaleFactor(double value);
717  /** Problem type as set by user or found by analysis.  This will be extended
718      0 - not known
719      1 - Set partitioning <=
720      2 - Set partitioning ==
721      3 - Set covering
722      4 - all +- 1 or all +1 and odd
723  */
724  void inline setProblemType(int number)
725  { problemType_=number;}
726  inline int problemType() const
727  { return problemType_;}
728
729  /// Set how often to scan global cuts
730  void setHowOftenGlobalScan(int number);
731  /// Get how often to scan global cuts
732  inline int howOftenGlobalScan() const
733  { return howOftenGlobalScan_;}
734  /// Original columns as created by integerPresolve or preprocessing
735  inline int * originalColumns() const
736  { return originalColumns_;}
737  /// Set original columns as created by preprocessing
738  void setOriginalColumns(const int * originalColumns) ;
739
740  /** Set the print frequency.
741 
742    Controls the number of nodes evaluated between status prints.
743    If <tt>number <=0</tt> the print frequency is set to 100 nodes for large
744    problems, 1000 for small problems.
745    Print frequency has very slight overhead if small.
746  */
747  inline void setPrintFrequency(int number)
748  { printFrequency_=number;}
749  /// Get the print frequency
750  inline int printFrequency() const
751  { return printFrequency_;}
752  //@}
753
754  //---------------------------------------------------------------------------
755  ///@name Methods returning info on how the solution process terminated
756  //@{
757    /// Are there a numerical difficulties?
758    bool isAbandoned() const;
759    /// Is optimality proven?
760    bool isProvenOptimal() const;
761    /// Is  infeasiblity proven (or none better than cutoff)?
762    bool isProvenInfeasible() const;
763    /// Was continuous solution unbounded
764    bool isContinuousUnbounded() const;
765    /// Was continuous solution unbounded
766    bool isProvenDualInfeasible() const;
767    /// Node limit reached?
768    bool isNodeLimitReached() const;
769    /// Time limit reached?
770    bool isSecondsLimitReached() const;
771    /// Solution limit reached?
772    bool isSolutionLimitReached() const;
773    /// Get how many iterations it took to solve the problem.
774    inline int getIterationCount() const
775    { return numberIterations_;}
776    /// Get how many Nodes it took to solve the problem.
777    inline int getNodeCount() const
778    { return numberNodes_;}
779    /** Final status of problem
780        Some of these can be found out by is...... functions
781        -1 before branchAndBound
782        0 finished - check isProvenOptimal or isProvenInfeasible to see if solution found
783        (or check value of best solution)
784        1 stopped - on maxnodes, maxsols, maxtime
785        2 difficulties so run was abandoned
786        (5 event user programmed event occurred)
787    */
788    inline int status() const
789    { return status_;}
790    inline void setProblemStatus(int value)
791    { status_=value;}
792    /** Secondary status of problem
793        -1 unset (status_ will also be -1)
794        0 search completed with solution
795        1 linear relaxation not feasible (or worse than cutoff)
796        2 stopped on gap
797        3 stopped on nodes
798        4 stopped on time
799        5 stopped on user event
800        6 stopped on solutions
801        7 linear relaxation unbounded
802    */
803    inline int secondaryStatus() const
804    { return secondaryStatus_;}
805    inline void setSecondaryStatus(int value)
806    { secondaryStatus_=value;}
807    /// Are there numerical difficulties (for initialSolve) ?
808    bool isInitialSolveAbandoned() const ;
809    /// Is optimality proven (for initialSolve) ?
810    bool isInitialSolveProvenOptimal() const ;
811    /// Is primal infeasiblity proven (for initialSolve) ?
812    bool isInitialSolveProvenPrimalInfeasible() const ;
813    /// Is dual infeasiblity proven (for initialSolve) ?
814    bool isInitialSolveProvenDualInfeasible() const ;
815
816  //@}
817
818  //---------------------------------------------------------------------------
819  /**@name Problem information methods
820     
821     These methods call the solver's query routines to return
822     information about the problem referred to by the current object.
823     Querying a problem that has no data associated with it result in
824     zeros for the number of rows and columns, and NULL pointers from
825     the methods that return vectors.
826     
827     Const pointers returned from any data-query method are valid as
828     long as the data is unchanged and the solver is not called.
829  */
830  //@{
831  /// Number of rows in continuous (root) problem.
832  inline int numberRowsAtContinuous() const
833  { return numberRowsAtContinuous_;}
834
835  /// Get number of columns
836  inline int getNumCols() const
837  { return solver_->getNumCols();}
838 
839  /// Get number of rows
840  inline int getNumRows() const
841  { return solver_->getNumRows();}
842 
843  /// Get number of nonzero elements
844  inline CoinBigIndex getNumElements() const
845  { return solver_->getNumElements();}
846
847  /// Number of integers in problem
848  inline int numberIntegers() const
849  { return numberIntegers_;}
850  // Integer variables
851  inline const int * integerVariable() const 
852  { return integerVariable_;}
853  /// Whether or not integer
854  inline char integerType(int i) const
855  { return integerInfo_[i];}
856  /// Whether or not integer
857  inline const char * integerType() const
858  { return integerInfo_;}
859
860  /// Get pointer to array[getNumCols()] of column lower bounds
861  inline const double * getColLower() const
862  { return solver_->getColLower();}
863 
864  /// Get pointer to array[getNumCols()] of column upper bounds
865  inline const double * getColUpper() const
866  { return solver_->getColUpper();}
867 
868  /** Get pointer to array[getNumRows()] of row constraint senses.
869      <ul>
870      <li>'L': <= constraint
871      <li>'E': =  constraint
872      <li>'G': >= constraint
873      <li>'R': ranged constraint
874      <li>'N': free constraint
875      </ul>
876  */
877  inline const char * getRowSense() const
878  { return solver_->getRowSense();}
879 
880  /** Get pointer to array[getNumRows()] of rows right-hand sides
881      <ul>
882      <li> if rowsense()[i] == 'L' then rhs()[i] == rowupper()[i]
883      <li> if rowsense()[i] == 'G' then rhs()[i] == rowlower()[i]
884      <li> if rowsense()[i] == 'R' then rhs()[i] == rowupper()[i]
885      <li> if rowsense()[i] == 'N' then rhs()[i] == 0.0
886      </ul>
887  */
888  inline const double * getRightHandSide() const
889  { return solver_->getRightHandSide();}
890 
891  /** Get pointer to array[getNumRows()] of row ranges.
892      <ul>
893      <li> if rowsense()[i] == 'R' then
894      rowrange()[i] == rowupper()[i] - rowlower()[i]
895      <li> if rowsense()[i] != 'R' then
896      rowrange()[i] is 0.0
897      </ul>
898  */
899  inline const double * getRowRange() const
900  { return solver_->getRowRange();}
901 
902  /// Get pointer to array[getNumRows()] of row lower bounds
903  inline const double * getRowLower() const
904  { return solver_->getRowLower();}
905 
906  /// Get pointer to array[getNumRows()] of row upper bounds
907  inline const double * getRowUpper() const
908  { return solver_->getRowUpper();}
909 
910  /// Get pointer to array[getNumCols()] of objective function coefficients
911  inline const double * getObjCoefficients() const
912  { return solver_->getObjCoefficients();}
913 
914  /// Get objective function sense (1 for min (default), -1 for max)
915  inline double getObjSense() const
916  {
917    //assert (dblParam_[CbcOptimizationDirection]== solver_->getObjSense());
918    return dblParam_[CbcOptimizationDirection];}
919 
920  /// Return true if variable is continuous
921  inline bool isContinuous(int colIndex) const
922  { return solver_->isContinuous(colIndex);}
923 
924  /// Return true if variable is binary
925  inline bool isBinary(int colIndex) const
926  { return solver_->isBinary(colIndex);}
927 
928  /** Return true if column is integer.
929      Note: This function returns true if the the column
930      is binary or a general integer.
931  */
932  inline bool isInteger(int colIndex) const
933  { return solver_->isInteger(colIndex);}
934 
935  /// Return true if variable is general integer
936  inline bool isIntegerNonBinary(int colIndex) const
937  { return solver_->isIntegerNonBinary(colIndex);}
938 
939  /// Return true if variable is binary and not fixed at either bound
940  inline bool isFreeBinary(int colIndex) const
941  { return solver_->isFreeBinary(colIndex) ;}
942 
943  /// Get pointer to row-wise copy of matrix
944  inline const CoinPackedMatrix * getMatrixByRow() const
945  { return solver_->getMatrixByRow();}
946 
947  /// Get pointer to column-wise copy of matrix
948  inline const CoinPackedMatrix * getMatrixByCol() const
949  { return solver_->getMatrixByCol();}
950 
951  /// Get solver's value for infinity
952  inline double getInfinity() const
953  { return solver_->getInfinity();}
954  /// Get pointer to array[getNumCols()] (for speed) of column lower bounds
955  inline const double * getCbcColLower() const
956  { return cbcColLower_;}
957  /// Get pointer to array[getNumCols()] (for speed) of column upper bounds
958  inline const double * getCbcColUpper() const
959  { return cbcColUpper_;}
960  /// Get pointer to array[getNumRows()] (for speed) of row lower bounds
961  inline const double * getCbcRowLower() const
962  { return cbcRowLower_;}
963  /// Get pointer to array[getNumRows()] (for speed) of row upper bounds
964  inline const double * getCbcRowUpper() const
965  { return cbcRowUpper_;}
966  /// Get pointer to array[getNumCols()] (for speed) of primal solution vector
967  inline const double * getCbcColSolution() const
968  { return cbcColSolution_;}
969  /// Get pointer to array[getNumRows()] (for speed) of dual prices
970  inline const double * getCbcRowPrice() const
971  { return cbcRowPrice_;}
972  /// Get a pointer to array[getNumCols()] (for speed) of reduced costs
973  inline const double * getCbcReducedCost() const
974  { return cbcReducedCost_;}
975  /// Get pointer to array[getNumRows()] (for speed) of row activity levels.
976  inline const double * getCbcRowActivity() const
977  { return cbcRowActivity_;}
978  //@}
979 
980 
981  /**@name Methods related to querying the solution */
982  //@{
983  /// Holds solution at continuous (after cuts if branchAndBound called)
984  inline double * continuousSolution() const
985  { return continuousSolution_;}
986  /** Array marked whenever a solution is found if non-zero.
987      Code marks if heuristic returns better so heuristic
988      need only mark if it wants to on solutions which
989      are worse than current */
990  inline int * usedInSolution() const
991  { return usedInSolution_;}
992  /// Increases usedInSolution for nonzeros
993  void incrementUsed(const double * solution);
994  /// Record a new incumbent solution and update objectiveValue
995  void setBestSolution(CBC_Message how,
996                       double & objectiveValue, const double *solution,
997                       bool fixVariables=false);
998  /// Just update objectiveValue
999  void setBestObjectiveValue( double objectiveValue);
1000
1001  /** Call this to really test if a valid solution can be feasible
1002      Solution is number columns in size.
1003      If fixVariables true then bounds of continuous solver updated.
1004      Returns objective value (worse than cutoff if not feasible)
1005      Previously computed objective value is now passed in (in case user does not do solve)
1006 */
1007  double checkSolution(double cutoff, const double * solution,
1008                       bool fixVariables, double originalObjValue);
1009  /** Test the current solution for feasiblility.
1010
1011    Scan all objects for indications of infeasibility. This is broken down
1012    into simple integer infeasibility (\p numberIntegerInfeasibilities)
1013    and all other reports of infeasibility (\p numberObjectInfeasibilities).
1014  */
1015  bool feasibleSolution(int & numberIntegerInfeasibilities,
1016                        int & numberObjectInfeasibilities) const;
1017
1018  /** Solution to the most recent lp relaxation.
1019
1020    The solver's solution to the most recent lp relaxation.
1021  */
1022   
1023  inline double * currentSolution() const
1024  { return currentSolution_;}
1025  /** For testing infeasibilities - will point to
1026      currentSolution_ or solver-->getColSolution()
1027  */
1028  inline const double * testSolution() const
1029  { return testSolution_;}
1030  inline void setTestSolution(const double * solution)
1031  { testSolution_ = solution;}
1032  /// Make sure region there and optionally copy solution
1033  void reserveCurrentSolution(const double * solution=NULL);
1034
1035  /// Get pointer to array[getNumCols()] of primal solution vector
1036  inline const double * getColSolution() const
1037  { return solver_->getColSolution();}
1038 
1039  /// Get pointer to array[getNumRows()] of dual prices
1040  inline const double * getRowPrice() const
1041  { return solver_->getRowPrice();}
1042 
1043  /// Get a pointer to array[getNumCols()] of reduced costs
1044  inline const double * getReducedCost() const
1045  { return solver_->getReducedCost();}
1046 
1047  /// Get pointer to array[getNumRows()] of row activity levels.
1048  inline const double * getRowActivity() const
1049  { return solver_->getRowActivity();}
1050 
1051  /// Get current objective function value
1052  inline double getCurrentObjValue() const
1053  { return dblParam_[CbcCurrentObjectiveValue]; }
1054  /// Get current minimization objective function value
1055  inline double getCurrentMinimizationObjValue() const
1056  { return dblParam_[CbcCurrentMinimizationObjectiveValue];}
1057 
1058  /// Get best objective function value as minimization
1059  inline double getMinimizationObjValue() const
1060  { return bestObjective_;}
1061  /// Set best objective function value as minimization
1062  inline void setMinimizationObjValue(double value) 
1063  { bestObjective_=value;}
1064 
1065  /// Get best objective function value
1066  inline double getObjValue() const
1067  { return bestObjective_ * solver_->getObjSense() ; } 
1068  /** Get best possible objective function value.
1069      This is better of best possible left on tree
1070      and best solution found.
1071      If called from within branch and cut may be optimistic.
1072  */
1073  double getBestPossibleObjValue() const;
1074  /// Set best objective function value
1075  inline void setObjValue(double value) 
1076  { bestObjective_=value * solver_->getObjSense() ;}
1077 
1078  /** The best solution to the integer programming problem.
1079
1080    The best solution to the integer programming problem found during
1081    the search. If no solution is found, the method returns null.
1082  */
1083
1084  inline double * bestSolution() const
1085  { return bestSolution_;}
1086  void setBestSolution(const double * solution,int numberColumns,double objectiveValue);
1087 
1088  /// Get number of solutions
1089  inline int getSolutionCount() const
1090  { return numberSolutions_;}
1091 
1092  /// Set number of solutions (so heuristics will be different)
1093  inline void setSolutionCount(int value) 
1094  { numberSolutions_=value;}
1095  /** Current phase (so heuristics etc etc can find out).
1096      0 - initial solve
1097      1 - solve with cuts at root
1098      2 - solve with cuts
1099      3 - other e.g. strong branching
1100      4 - trying to validate a solution
1101      5 - at end of search
1102  */
1103  inline int phase() const
1104  { return phase_;}
1105 
1106  /// Get number of heuristic solutions
1107  inline int getNumberHeuristicSolutions() const { return numberHeuristicSolutions_;}
1108
1109  /// Set objective function sense (1 for min (default), -1 for max,)
1110  inline void setObjSense(double s) { dblParam_[CbcOptimizationDirection]=s;
1111  solver_->setObjSense(s);}
1112
1113  /// Value of objective at continuous
1114  inline double getContinuousObjective() const
1115  { return originalContinuousObjective_;}
1116  inline void setContinuousObjective(double value)
1117  { originalContinuousObjective_=value;}
1118  /// Number of infeasibilities at continuous
1119  inline int getContinuousInfeasibilities() const
1120  { return continuousInfeasibilities_;}
1121  inline void setContinuousInfeasibilities(int value)
1122  { continuousInfeasibilities_=value;}
1123  /// Value of objective after root node cuts added
1124  inline double rootObjectiveAfterCuts() const
1125  { return continuousObjective_;}
1126  /// Sum of Changes to objective by first solve
1127  inline double sumChangeObjective() const
1128  { return sumChangeObjective1_;}
1129  /** Number of times global cuts violated.  When global cut pool then this
1130      should be kept for each cut and type of cut */
1131  inline int numberGlobalViolations() const
1132  { return numberGlobalViolations_;}
1133  inline void clearNumberGlobalViolations()
1134  { numberGlobalViolations_=0;}
1135  /// Whether to force a resolve after takeOffCuts
1136  inline bool resolveAfterTakeOffCuts() const
1137  { return resolveAfterTakeOffCuts_;}
1138  inline void setResolveAfterTakeOffCuts(bool yesNo)
1139  { resolveAfterTakeOffCuts_=yesNo;}
1140  /// Get number of threads
1141  inline int getNumberThreads() const
1142  { return numberThreads_;}
1143  /// Set number of threads
1144  inline void setNumberThreads(int value) 
1145  { numberThreads_=value;}
1146  /// Get thread mode
1147  inline int getThreadMode() const
1148  { return threadMode_;}
1149  /** Set thread mode
1150      always use numberThreads for branching
1151      1 set then use numberThreads in root mini branch and bound
1152      2 set then use numberThreads for root cuts
1153      default is 0
1154  */
1155  inline void setThreadMode(int value) 
1156  { threadMode_=value;}
1157  //@}
1158
1159  /** \name Node selection */
1160  //@{
1161  // Comparison functions (which may be overridden by inheritance)
1162  inline CbcCompareBase * nodeComparison() const
1163  { return nodeCompare_;}
1164  void setNodeComparison(CbcCompareBase * compare);
1165  void setNodeComparison(CbcCompareBase & compare);
1166  //@}
1167
1168  /** \name Problem feasibility checking */
1169  //@{
1170  // Feasibility functions (which may be overridden by inheritance)
1171  inline CbcFeasibilityBase * problemFeasibility() const
1172  { return problemFeasibility_;}
1173  void setProblemFeasibility(CbcFeasibilityBase * feasibility);
1174  void setProblemFeasibility(CbcFeasibilityBase & feasibility);
1175  //@}
1176
1177  /** \name Tree methods and subtree methods */
1178  //@{
1179  /// Tree method e.g. heap (which may be overridden by inheritance)
1180  inline CbcTree * tree() const
1181  { return tree_;}
1182  /// For modifying tree handling (original is cloned)
1183  void passInTreeHandler(CbcTree & tree);
1184  /** For passing in an CbcModel to do a sub Tree (with derived tree handlers).
1185      Passed in model must exist for duration of branch and bound
1186  */
1187  void passInSubTreeModel(CbcModel & model);
1188  /** For retrieving a copy of subtree model with given OsiSolver.
1189      If no subtree model will use self (up to user to reset cutoff etc).
1190      If solver NULL uses current
1191  */
1192  CbcModel * subTreeModel(OsiSolverInterface * solver=NULL) const;
1193  /// Returns number of times any subtree stopped on nodes, time etc
1194  inline int numberStoppedSubTrees() const
1195  { return numberStoppedSubTrees_;}
1196  /// Says a sub tree was stopped
1197  inline void incrementSubTreeStopped()
1198  { numberStoppedSubTrees_++;}
1199  /** Whether to automatically do presolve before branch and bound (subTrees).
1200      0 - no
1201      1 - ordinary presolve
1202      2 - integer presolve (dodgy)
1203  */
1204  inline int typePresolve() const
1205  { return presolve_;}
1206  inline void setTypePresolve(int value)
1207  { presolve_=value;}
1208 
1209  //@}
1210
1211  /** \name Branching Decisions
1212 
1213    See the CbcBranchDecision class for additional information.
1214  */
1215  //@{
1216
1217  /// Get the current branching decision method.
1218  inline CbcBranchDecision * branchingMethod() const
1219  { return branchingMethod_;}
1220  /// Set the branching decision method.
1221  inline void setBranchingMethod(CbcBranchDecision * method)
1222  { delete branchingMethod_; branchingMethod_ = method->clone();}
1223  /** Set the branching method
1224 
1225    \overload
1226  */
1227  inline void setBranchingMethod(CbcBranchDecision & method)
1228  { delete branchingMethod_; branchingMethod_ = method.clone();}
1229  /// Get the current cut modifier method
1230  inline CbcCutModifier * cutModifier() const
1231  { return cutModifier_;}
1232  /// Set the cut modifier method
1233  void setCutModifier(CbcCutModifier * modifier);
1234  /** Set the cut modifier method
1235 
1236    \overload
1237  */
1238  void setCutModifier(CbcCutModifier & modifier);
1239  //@}
1240
1241  /** \name Row (constraint) and Column (variable) cut generation */
1242  //@{
1243
1244  /** State of search
1245      0 - no solution
1246      1 - only heuristic solutions
1247      2 - branched to a solution
1248      3 - no solution but many nodes
1249  */
1250  inline int stateOfSearch() const
1251  { return stateOfSearch_;}
1252  inline void setStateOfSearch(int state)
1253  { stateOfSearch_=state;}
1254  /// Strategy worked out - mainly at root node for use by CbcNode
1255  inline int searchStrategy() const
1256  { return searchStrategy_;}
1257  /// Set strategy worked out - mainly at root node for use by CbcNode
1258  inline void setSearchStrategy(int value)
1259  { searchStrategy_ = value; }
1260
1261  /// Get the number of cut generators
1262  inline int numberCutGenerators() const
1263  { return numberCutGenerators_;}
1264  /// Get the list of cut generators
1265  inline CbcCutGenerator ** cutGenerators() const
1266  { return generator_;}
1267  ///Get the specified cut generator
1268  inline CbcCutGenerator * cutGenerator(int i) const
1269  { return generator_[i];}
1270  ///Get the specified cut generator before any changes
1271  inline CbcCutGenerator * virginCutGenerator(int i) const
1272  { return virginGenerator_[i];}
1273  /** Add one generator - up to user to delete generators.
1274      howoften affects how generator is used. 0 or 1 means always,
1275      >1 means every that number of nodes.  Negative values have same
1276      meaning as positive but they may be switched off (-> -100) by code if
1277      not many cuts generated at continuous.  -99 is just done at root.
1278      Name is just for printout.
1279      If depth >0 overrides how often generator is called (if howOften==-1 or >0).
1280  */
1281  void addCutGenerator(CglCutGenerator * generator,
1282                       int howOften=1, const char * name=NULL,
1283                       bool normal=true, bool atSolution=false, 
1284                       bool infeasible=false,int howOftenInSub=-100,
1285                       int whatDepth=-1, int whatDepthInSub=-1);
1286//@}
1287  /** \name Strategy and sub models
1288 
1289    See the CbcStrategy class for additional information.
1290  */
1291  //@{
1292
1293  /// Get the current strategy
1294  inline CbcStrategy * strategy() const
1295  { return strategy_;}
1296  /// Set the strategy. Clones
1297  void setStrategy(CbcStrategy & strategy);
1298  /// Get the current parent model
1299  inline CbcModel * parentModel() const
1300  { return parentModel_;}
1301  /// Set the parent model
1302  inline void setParentModel(CbcModel & parentModel)
1303  { parentModel_ = &parentModel;}
1304  //@}
1305
1306
1307  /** \name Heuristics and priorities */
1308  //@{
1309  /*! \brief Add one heuristic - up to user to delete
1310
1311    The name is just used for print messages.
1312  */
1313  void addHeuristic(CbcHeuristic * generator, const char *name = NULL);
1314  ///Get the specified heuristic
1315  inline CbcHeuristic * heuristic(int i) const
1316  { return heuristic_[i];}
1317  /// Get the number of heuristics
1318  inline int numberHeuristics() const
1319  { return numberHeuristics_;}
1320  /// Pointer to heuristic solver which found last solution (or NULL)
1321  inline CbcHeuristic * lastHeuristic() const
1322  { return lastHeuristic_;}
1323  /// set last heuristic which found a solution
1324  inline void setLastHeuristic(CbcHeuristic * last)
1325  { lastHeuristic_=last;}
1326
1327  /** Pass in branching priorities.
1328 
1329      If ifClique then priorities are on cliques otherwise priorities are
1330      on integer variables. 
1331      Other type (if exists set to default)
1332      1 is highest priority. (well actually -INT_MAX is but that's ugly)
1333      If hotstart > 0 then branches are created to force
1334      the variable to the value given by best solution.  This enables a
1335      sort of hot start.  The node choice should be greatest depth
1336      and hotstart should normally be switched off after a solution.
1337
1338      If ifNotSimpleIntegers true then appended to normal integers
1339
1340      This is now deprecated except for simple usage.  If user
1341      creates Cbcobjects then set priority in them
1342
1343      \internal Added for Kurt Spielberg.
1344  */
1345  void passInPriorities(const int * priorities, bool ifNotSimpleIntegers);
1346
1347  /// Returns priority level for an object (or 1000 if no priorities exist)
1348  inline int priority(int sequence) const
1349  { return object_[sequence]->priority();}
1350
1351  /*! \brief Set an event handler
1352 
1353    A clone of the handler passed as a parameter is stored in CbcModel.
1354  */
1355  void passInEventHandler(const CbcEventHandler *eventHandler) ;
1356
1357  /*! \brief Retrieve a pointer to the event handler */
1358  inline CbcEventHandler* getEventHandler() const
1359  { return (eventHandler_) ; } 
1360
1361  //@}
1362   
1363  /**@name Setting/Accessing application data */
1364  //@{
1365    /** Set application data.
1366
1367        This is a pointer that the application can store into and
1368        retrieve from the solver interface.
1369        This field is available for the application to optionally
1370        define and use.
1371    */
1372    void setApplicationData (void * appData);
1373
1374    /// Get application data
1375    void * getApplicationData() const;
1376  /**
1377      For advanced applications you may wish to modify the behavior of Cbc
1378      e.g. if the solver is a NLP solver then you may not have an exact
1379      optimum solution at each step.  Information could be built into
1380      OsiSolverInterface but this is an alternative so that that interface
1381      does not have to be changed.  If something similar is useful to
1382      enough solvers then it could be migrated
1383      You can also pass in by using solver->setAuxiliaryInfo.
1384      You should do that if solver is odd - if solver is normal simplex
1385      then use this.
1386      NOTE - characteristics are not cloned
1387  */
1388  void passInSolverCharacteristics(OsiBabSolver * solverCharacteristics);
1389  /// Get solver characteristics
1390  inline const OsiBabSolver * solverCharacteristics() const
1391  { return solverCharacteristics_;}
1392  //@}
1393 
1394  //---------------------------------------------------------------------------
1395
1396  /**@name Message handling */
1397  //@{
1398  /// Pass in Message handler (not deleted at end)
1399  void passInMessageHandler(CoinMessageHandler * handler);
1400  /// Set language
1401  void newLanguage(CoinMessages::Language language);
1402  inline void setLanguage(CoinMessages::Language language)
1403  {newLanguage(language);}
1404  /// Return handler
1405  inline CoinMessageHandler * messageHandler() const
1406  {return handler_;}
1407  /// Return messages
1408  inline CoinMessages & messages() 
1409  {return messages_;}
1410  /// Return pointer to messages
1411  inline CoinMessages * messagesPointer() 
1412  {return &messages_;}
1413  /// Set log level
1414  void setLogLevel(int value);
1415  /// Get log level
1416  inline int logLevel() const
1417  { return handler_->logLevel();}
1418  //@}
1419  //---------------------------------------------------------------------------
1420  ///@name Specialized
1421  //@{
1422
1423  /**
1424      Set special options
1425      0 bit (1) - check if cuts valid (if on debugger list)
1426      1 bit (2) - use current basis to check integer solution (rather than all slack)
1427      2 bit (4) - don't check integer solution (by solving LP)
1428      3 bit (8) - fast analyze
1429      4 bit (16) - non-linear model - so no well defined CoinPackedMatrix
1430      5 bit (32) - keep names
1431      6 bit (64) - try for dominated columns
1432  */
1433  /// Set special options
1434  inline void setSpecialOptions(int value)
1435  { specialOptions_=value;}
1436  /// Get special options
1437  inline int specialOptions() const
1438  { return specialOptions_;}
1439  /// Says if normal solver i.e. has well defined CoinPackedMatrix
1440  inline bool normalSolver() const
1441  { return (specialOptions_&16)==0;}
1442  /// Now we may not own objects - just point to solver's objects
1443  inline bool ownObjects() const
1444  { return ownObjects_;}
1445  /// Pointer to a mutex
1446  inline void * mutex()
1447  { return mutex_;}
1448  //@}
1449  //---------------------------------------------------------------------------
1450
1451  ///@name Constructors and destructors etc
1452  //@{
1453    /// Default Constructor
1454    CbcModel(); 
1455   
1456    /// Constructor from solver
1457    CbcModel(const OsiSolverInterface &);
1458 
1459    /** Assign a solver to the model (model assumes ownership)
1460
1461      On return, \p solver will be NULL.
1462      If deleteSolver then current solver deleted (if model owned)
1463
1464      \note Parameter settings in the outgoing solver are not inherited by
1465            the incoming solver.
1466    */
1467    void assignSolver(OsiSolverInterface *&solver,bool deleteSolver=true);
1468
1469    /** \brief Set ownership of solver
1470
1471      A parameter of false tells CbcModel it does not own the solver and
1472      should not delete it. Once you claim ownership of the solver, you're
1473      responsible for eventually deleting it. Note that CbcModel clones
1474      solvers with abandon.  Unless you have a deep understanding of the
1475      workings of CbcModel, the only time you want to claim ownership is when
1476      you're about to delete the CbcModel object but want the solver to
1477      continue to exist (as, for example, when branchAndBound has finished
1478      and you want to hang on to the answer).
1479    */
1480    inline void setModelOwnsSolver (bool ourSolver)
1481    { ourSolver_ = ourSolver ; } 
1482
1483    /*! \brief Get ownership of solver
1484   
1485      A return value of true means that CbcModel owns the solver and will
1486      take responsibility for deleting it when that becomes necessary.
1487    */
1488    inline bool modelOwnsSolver () { return (ourSolver_) ; } 
1489 
1490    /** Copy constructor .
1491      If noTree is true then tree and cuts are not copied
1492    */ 
1493    CbcModel(const CbcModel & rhs, bool noTree=false);
1494 
1495    /// Assignment operator
1496    CbcModel & operator=(const CbcModel& rhs);
1497 
1498    /// Destructor
1499     ~CbcModel ();
1500
1501    /// Returns solver - has current state
1502    inline OsiSolverInterface * solver() const
1503    { return solver_;}
1504
1505    /// Returns solver with continuous state
1506    inline OsiSolverInterface * continuousSolver() const
1507    { return continuousSolver_;}
1508
1509  /// A copy of the solver, taken at constructor or by saveReferenceSolver
1510  inline OsiSolverInterface * referenceSolver() const
1511  { return referenceSolver_;}
1512
1513  /// Save a copy of the current solver so can be reset to
1514  void saveReferenceSolver();
1515
1516  /** Uses a copy of reference solver to be current solver.
1517      Because of possible mismatches all exotic integer information is loat
1518      (apart from normal information in OsiSolverInterface)
1519      so SOS etc and priorities will have to be redone
1520  */
1521  void resetToReferenceSolver();
1522
1523  /// Clears out as much as possible (except solver)
1524  void gutsOfDestructor();
1525  /** Clears out enough to reset CbcModel as if no branch and bound done
1526   */
1527  void gutsOfDestructor2();
1528  /** Clears out enough to reset CbcModel cutoff etc
1529   */
1530  void resetModel();
1531  /// Move status, nodes etc etc across
1532  void moveInfo(const CbcModel & rhs);
1533  //@}
1534
1535  ///@semi-private i.e. users should not use
1536  //@{
1537    /// Get how many Nodes it took to solve the problem.
1538    int getNodeCount2() const
1539    { return numberNodes2_;}
1540  /// Set pointers for speed
1541  void setPointers(const OsiSolverInterface * solver);
1542  /** Perform reduced cost fixing
1543
1544    Fixes integer variables at their current value based on reduced cost
1545    penalties.  Returns number fixed
1546  */
1547  int reducedCostFix() ;
1548  /// Encapsulates solver resolve
1549  int resolve(OsiSolverInterface * solver);
1550
1551  /** Encapsulates choosing a variable -
1552      anyAction -2, infeasible (-1 round again), 0 done
1553  */
1554  int chooseBranch(CbcNode * newNode, int numberPassesLeft,
1555                   CbcNode * oldNode, OsiCuts & cuts,
1556                   bool & resolved, CoinWarmStartBasis *lastws,
1557                   const double * lowerBefore,const double * upperBefore,
1558                   OsiSolverBranch * & branches);
1559  int chooseBranch(CbcNode * newNode, int numberPassesLeft, bool & resolved);
1560
1561  /** Return an empty basis object of the specified size
1562
1563    A useful utility when constructing a basis for a subproblem from scratch.
1564    The object returned will be of the requested capacity and appropriate for
1565    the solver attached to the model.
1566  */
1567  CoinWarmStartBasis *getEmptyBasis(int ns = 0, int na = 0) const ;
1568
1569  /** Remove inactive cuts from the model
1570
1571    An OsiSolverInterface is expected to maintain a valid basis, but not a
1572    valid solution, when loose cuts are deleted. Restoring a valid solution
1573    requires calling the solver to reoptimise. If it's certain the solution
1574    will not be required, set allowResolve to false to suppress
1575    reoptimisation.
1576    If saveCuts then slack cuts will be saved
1577  */
1578  void takeOffCuts(OsiCuts &cuts, 
1579                     bool allowResolve,OsiCuts * saveCuts) ;
1580
1581  /** Determine and install the active cuts that need to be added for
1582    the current subproblem
1583
1584    The whole truth is a bit more complicated. The first action is a call to
1585    addCuts1(). addCuts() then sorts through the list, installs the tight
1586    cuts in the model, and does bookkeeping (adjusts reference counts).
1587    The basis returned from addCuts1() is adjusted accordingly.
1588   
1589    If it turns out that the node should really be fathomed by bound,
1590    addCuts() simply treats all the cuts as loose as it does the bookkeeping.
1591
1592    canFix true if extra information being passed
1593  */
1594  int addCuts(CbcNode * node, CoinWarmStartBasis *&lastws,bool canFix);
1595
1596  /** Traverse the tree from node to root and prep the model
1597
1598    addCuts1() begins the job of prepping the model to match the current
1599    subproblem. The model is stripped of all cuts, and the search tree is
1600    traversed from node to root to determine the changes required. Appropriate
1601    bounds changes are installed, a list of cuts is collected but not
1602    installed, and an appropriate basis (minus the cuts, but big enough to
1603    accommodate them) is constructed.
1604
1605    \todo addCuts1() is called in contexts where it's known in advance that
1606          all that's desired is to determine a list of cuts and do the
1607          bookkeeping (adjust the reference counts). The work of installing
1608          bounds and building a basis goes to waste.
1609  */
1610  void addCuts1(CbcNode * node, CoinWarmStartBasis *&lastws);
1611  /** Set objective value in a node.  This is separated out so that
1612     odd solvers can use.  It may look at extra information in
1613     solverCharacteriscs_ and will also use bound from parent node
1614  */
1615  void setObjectiveValue(CbcNode * thisNode, const CbcNode * parentNode) const;
1616
1617  /** If numberBeforeTrust >0 then we are going to use CbcBranchDynamic.
1618      Scan and convert CbcSimpleInteger objects
1619  */
1620  void convertToDynamic();
1621  /// Use cliques for pseudocost information - return nonzero if infeasible
1622  int cliquePseudoCosts(int doStatistics);
1623  /// Fill in useful estimates
1624  void pseudoShadow(double * down, double * up);
1625
1626  /// Get the hotstart solution
1627  inline const double * hotstartSolution() const
1628  { return hotstartSolution_;}
1629  /// Get the hotstart priorities
1630  inline const int * hotstartPriorities() const
1631  { return hotstartPriorities_;}
1632
1633  /// Return the list of cuts initially collected for this subproblem
1634  inline CbcCountRowCut ** addedCuts() const
1635  { return addedCuts_;}
1636  /// Number of entries in the list returned by #addedCuts()
1637  inline int currentNumberCuts() const
1638  { return currentNumberCuts_;}
1639  /// Global cuts
1640  inline OsiCuts * globalCuts() 
1641  { return &globalCuts_;}
1642  /// Copy and set a pointer to a row cut which will be added instead of normal branching.
1643  void setNextRowCut(const OsiRowCut & cut);
1644  /// Get a pointer to current node (be careful)
1645  inline CbcNode * currentNode() const
1646  { return currentNode_;}
1647  /// Get a pointer to probing info
1648  inline CglTreeProbingInfo * probingInfo() const
1649  { return probingInfo_;}
1650  /// Set the number of iterations done in strong branching.
1651  inline void setNumberStrongIterations(int number)
1652  { numberStrongIterations_ = number;}
1653  /// Get the number of iterations done in strong branching.
1654  inline int numberStrongIterations() const
1655  { return numberStrongIterations_;}
1656  /// Increment strong info
1657  void incrementStrongInfo(int numberTimes, int numberIterations,
1658                           int numberFixed, bool ifInfeasible);
1659  /// Create C++ lines to get to current state
1660  void generateCpp( FILE * fp,int options);
1661  /// Generate an OsiBranchingInformation object
1662  OsiBranchingInformation usefulInformation() const;
1663  /** Warm start object produced by heuristic or strong branching
1664
1665      If get a valid integer solution outside branch and bound then it can take
1666      a reasonable time to solve LP which produces clean solution.  If this object has
1667      any size then it will be used in solve.
1668  */
1669  inline void setBestSolutionBasis(const CoinWarmStartBasis & bestSolutionBasis)
1670  { bestSolutionBasis_ = bestSolutionBasis;}
1671  //@}
1672
1673//---------------------------------------------------------------------------
1674
1675private:
1676  ///@name Private member data
1677  //@{
1678
1679  /// The solver associated with this model.
1680  OsiSolverInterface * solver_;
1681
1682  /** Ownership of the solver object
1683
1684    The convention is that CbcModel owns the null solver. Currently there
1685    is no public method to give CbcModel a solver without giving ownership,
1686    but the hook is here.
1687  */
1688  bool ourSolver_ ;
1689
1690  /// A copy of the solver, taken at the continuous (root) node.
1691  OsiSolverInterface * continuousSolver_;
1692
1693  /// A copy of the solver, taken at constructor or by saveReferenceSolver
1694  OsiSolverInterface * referenceSolver_;
1695
1696   /// Message handler
1697  CoinMessageHandler * handler_;
1698
1699  /** Flag to say if handler_ is the default handler.
1700 
1701    The default handler is deleted when the model is deleted. Other
1702    handlers (supplied by the client) will not be deleted.
1703  */
1704  bool defaultHandler_;
1705
1706  /// Cbc messages
1707  CoinMessages messages_;
1708
1709  /// Array for integer parameters
1710  int intParam_[CbcLastIntParam];
1711
1712  /// Array for double parameters
1713  double dblParam_[CbcLastDblParam];
1714
1715  /** Pointer to an empty warm start object
1716
1717    It turns out to be useful to have this available as a base from
1718    which to build custom warm start objects. This is typed as CoinWarmStart
1719    rather than CoinWarmStartBasis to allow for the possibility that a
1720    client might want to apply a solver that doesn't use a basis-based warm
1721    start. See getEmptyBasis for an example of how this field can be used.
1722  */
1723  mutable CoinWarmStart *emptyWarmStart_ ;
1724
1725  /// Best objective
1726  double bestObjective_;
1727  /// Best possible objective
1728  double bestPossibleObjective_;
1729  /// Sum of Changes to objective by first solve
1730  double sumChangeObjective1_;
1731  /// Sum of Changes to objective by subsequent solves
1732  double sumChangeObjective2_;
1733
1734  /// Array holding the incumbent (best) solution.
1735  double * bestSolution_;
1736
1737  /** Array holding the current solution.
1738
1739    This array is used more as a temporary.
1740  */
1741  double * currentSolution_;
1742  /** For testing infeasibilities - will point to
1743      currentSolution_ or solver-->getColSolution()
1744  */
1745  mutable const double * testSolution_;
1746  /** Warm start object produced by heuristic or strong branching
1747
1748      If get a valid integer solution outside branch and bound then it can take
1749      a reasonable time to solve LP which produces clean solution.  If this object has
1750      any size then it will be used in solve.
1751  */
1752  CoinWarmStartBasis bestSolutionBasis_ ;
1753  /// Global cuts
1754  OsiCuts globalCuts_;
1755
1756  /// Minimum degradation in objective value to continue cut generation
1757  double minimumDrop_;
1758  /// Number of solutions
1759  int numberSolutions_;
1760  /** State of search
1761      0 - no solution
1762      1 - only heuristic solutions
1763      2 - branched to a solution
1764      3 - no solution but many nodes
1765  */
1766  int stateOfSearch_;
1767  /// Hotstart solution
1768  double * hotstartSolution_;
1769  /// Hotstart priorities
1770  int * hotstartPriorities_;
1771  /// Number of heuristic solutions
1772  int numberHeuristicSolutions_;
1773  /// Cumulative number of nodes
1774  int numberNodes_;
1775  /** Cumulative number of nodes for statistics.
1776      Must fix to match up
1777  */
1778  int numberNodes2_;
1779  /// Cumulative number of iterations
1780  int numberIterations_;
1781  /// Status of problem - 0 finished, 1 stopped, 2 difficulties
1782  int status_;
1783  /** Secondary status of problem
1784      -1 unset (status_ will also be -1)
1785      0 search completed with solution
1786      1 linear relaxation not feasible (or worse than cutoff)
1787      2 stopped on gap
1788      3 stopped on nodes
1789      4 stopped on time
1790      5 stopped on user event
1791      6 stopped on solutions
1792   */
1793  int secondaryStatus_;
1794  /// Number of integers in problem
1795  int numberIntegers_;
1796  /// Number of rows at continuous
1797  int numberRowsAtContinuous_;
1798  /// Maximum number of cuts
1799  int maximumNumberCuts_;
1800  /** Current phase (so heuristics etc etc can find out).
1801      0 - initial solve
1802      1 - solve with cuts at root
1803      2 - solve with cuts
1804      3 - other e.g. strong branching
1805      4 - trying to validate a solution
1806      5 - at end of search
1807  */
1808  int phase_;
1809
1810  /// Number of entries in #addedCuts_
1811  int currentNumberCuts_;
1812
1813  /** Current limit on search tree depth
1814
1815    The allocated size of #walkback_. Increased as needed.
1816  */
1817  int maximumDepth_;
1818  /** Array used to assemble the path between a node and the search tree root
1819
1820    The array is resized when necessary. #maximumDepth_  is the current
1821    allocated size.
1822  */
1823  CbcNodeInfo ** walkback_;
1824
1825  /** The list of cuts initially collected for this subproblem
1826
1827    When the subproblem at this node is rebuilt, a set of cuts is collected
1828    for inclusion in the constraint system. If any of these cuts are
1829    subsequently removed because they have become loose, the corresponding
1830    entry is set to NULL.
1831  */
1832  CbcCountRowCut ** addedCuts_;
1833
1834  /** A pointer to a row cut which will be added instead of normal branching.
1835      After use it should be set to NULL.
1836  */
1837  OsiRowCut * nextRowCut_;
1838
1839  /// Current node so can be used elsewhere
1840  CbcNode * currentNode_;
1841
1842  /// Indices of integer variables
1843  int * integerVariable_;
1844  /// Whether of not integer
1845  char * integerInfo_;
1846  /// Holds solution at continuous (after cuts)
1847  double * continuousSolution_;
1848  /// Array marked whenever a solution is found if non-zero
1849  int * usedInSolution_;
1850  /**
1851      0 bit (1) - check if cuts valid (if on debugger list)
1852      1 bit (2) - use current basis to check integer solution (rather than all slack)
1853      2 bit (4) - don't check integer solution
1854      3 bit (8) - Strong is doing well - keep on
1855  */
1856  int specialOptions_;
1857  /// User node comparison function
1858  CbcCompareBase * nodeCompare_;
1859  /// User feasibility function (see CbcFeasibleBase.hpp)
1860  CbcFeasibilityBase * problemFeasibility_;
1861  /// Tree
1862  CbcTree * tree_;
1863  /// A pointer to model to be used for subtrees
1864  CbcModel * subTreeModel_;
1865  /// Number of times any subtree stopped on nodes, time etc
1866  int numberStoppedSubTrees_;
1867  /// Variable selection function
1868  CbcBranchDecision * branchingMethod_;
1869  /// Cut modifier function
1870  CbcCutModifier * cutModifier_;
1871  /// Strategy
1872  CbcStrategy * strategy_;
1873  /// Parent model
1874  CbcModel * parentModel_;
1875  /** Whether to automatically do presolve before branch and bound.
1876      0 - no
1877      1 - ordinary presolve
1878      2 - integer presolve (dodgy)
1879  */
1880  /// Pointer to array[getNumCols()] (for speed) of column lower bounds
1881  const double * cbcColLower_;
1882  /// Pointer to array[getNumCols()] (for speed) of column upper bounds
1883  const double * cbcColUpper_;
1884  /// Pointer to array[getNumRows()] (for speed) of row lower bounds
1885  const double * cbcRowLower_;
1886  /// Pointer to array[getNumRows()] (for speed) of row upper bounds
1887  const double * cbcRowUpper_;
1888  /// Pointer to array[getNumCols()] (for speed) of primal solution vector
1889  const double * cbcColSolution_;
1890  /// Pointer to array[getNumRows()] (for speed) of dual prices
1891  const double * cbcRowPrice_;
1892  /// Get a pointer to array[getNumCols()] (for speed) of reduced costs
1893  const double * cbcReducedCost_;
1894  /// Pointer to array[getNumRows()] (for speed) of row activity levels.
1895  const double * cbcRowActivity_;
1896  /// Pointer to user-defined data structure
1897  void * appData_;
1898  /// Pointer to a mutex
1899  void * mutex_;
1900  /// Presolve for CbcTreeLocal
1901  int presolve_;
1902  /** Maximum number of candidates to consider for strong branching.
1903    To disable strong branching, set this to 0.
1904  */
1905  int numberStrong_;
1906  /** \brief The number of branches before pseudo costs believed
1907             in dynamic strong branching.
1908     
1909    A value of 0 is  off.
1910  */
1911  int numberBeforeTrust_;
1912  /** \brief The number of variables for which to compute penalties
1913             in dynamic strong branching.
1914  */
1915  int numberPenalties_;
1916  /** Scale factor to make penalties match strong.
1917      Should/will be computed */
1918  double penaltyScaleFactor_;
1919  /// Number of analyze iterations to do
1920  int numberAnalyzeIterations_;
1921  /// Arrays with analysis results
1922  double * analyzeResults_;
1923  /// Number of nodes infeasible by normal branching (before cuts)
1924  int numberInfeasibleNodes_;
1925  /** Problem type as set by user or found by analysis.  This will be extended
1926      0 - not known
1927      1 - Set partitioning <=
1928      2 - Set partitioning ==
1929      3 - Set covering
1930  */
1931  int problemType_;
1932  /// Print frequency
1933  int printFrequency_;
1934  /// Number of cut generators
1935  int numberCutGenerators_;
1936  // Cut generators
1937  CbcCutGenerator ** generator_;
1938  // Cut generators before any changes
1939  CbcCutGenerator ** virginGenerator_;
1940  /// Number of heuristics
1941  int numberHeuristics_;
1942  /// Heuristic solvers
1943  CbcHeuristic ** heuristic_;
1944  /// Pointer to heuristic solver which found last solution (or NULL)
1945  CbcHeuristic * lastHeuristic_;
1946  /*! Pointer to the event handler */
1947# ifdef CBC_ONLY_CLP
1948  ClpEventHandler *eventHandler_ ;
1949# else
1950  CbcEventHandler *eventHandler_ ;
1951# endif
1952
1953  /// Total number of objects
1954  int numberObjects_;
1955
1956  /** \brief Integer and Clique and ... information
1957
1958    \note The code assumes that the first objects on the list will be
1959          SimpleInteger objects for each integer variable, followed by
1960          Clique objects. Portions of the code that understand Clique objects
1961          will fail if they do not immediately follow the SimpleIntegers.
1962          Large chunks of the code will fail if the first objects are not
1963          SimpleInteger. As of 2003.08, SimpleIntegers and Cliques are the only
1964          objects.
1965  */
1966  OsiObject ** object_;
1967  /// Now we may not own objects - just point to solver's objects
1968  bool ownObjects_;
1969 
1970  /// Original columns as created by integerPresolve or preprocessing
1971  int * originalColumns_;
1972  /// How often to scan global cuts
1973  int howOftenGlobalScan_;
1974  /** Number of times global cuts violated.  When global cut pool then this
1975      should be kept for each cut and type of cut */
1976  int numberGlobalViolations_;
1977  /** Value of objective at continuous
1978      (Well actually after initial round of cuts)
1979  */
1980  double continuousObjective_;
1981  /** Value of objective before root node cuts added
1982  */
1983  double originalContinuousObjective_;
1984  /// Number of infeasibilities at continuous
1985  int continuousInfeasibilities_;
1986  /// Maximum number of cut passes at root
1987  int maximumCutPassesAtRoot_;
1988  /// Maximum number of cut passes
1989  int maximumCutPasses_;
1990  /// Preferred way of branching
1991  int preferredWay_;
1992  /// Current cut pass number
1993  int currentPassNumber_;
1994  /// Maximum number of cuts (for whichGenerator_)
1995  int maximumWhich_;
1996  /// Which cut generator generated this cut
1997  int * whichGenerator_;
1998  /// Maximum number of statistics
1999  int maximumStatistics_;
2000  /// statistics
2001  CbcStatistics ** statistics_;
2002  /// Maximum depth reached
2003  int maximumDepthActual_;
2004  /// Number of reduced cost fixings
2005  double numberDJFixed_;
2006  /// Probing info
2007  CglTreeProbingInfo * probingInfo_;
2008  /// Number of fixed by analyze at root
2009  int numberFixedAtRoot_;
2010  /// Number fixed by analyze so far
2011  int numberFixedNow_;
2012  /// Whether stopping on gap
2013  bool stoppedOnGap_;
2014  /// Whether event happened
2015  bool eventHappened_;
2016  /// Number of long strong goes
2017  int numberLongStrong_;
2018  /// Number of old active cuts
2019  int numberOldActiveCuts_;
2020  /// Number of new cuts
2021  int numberNewCuts_;
2022  /// Size of mini - tree
2023  int sizeMiniTree_;
2024  /// Strategy worked out - mainly at root node
2025  int searchStrategy_;
2026  /// Number of iterations in strong branching
2027  int numberStrongIterations_;
2028  /** 0 - number times strong branching done, 1 - number fixed, 2 - number infeasible */
2029  int strongInfo_[3];
2030  /**
2031      For advanced applications you may wish to modify the behavior of Cbc
2032      e.g. if the solver is a NLP solver then you may not have an exact
2033      optimum solution at each step.  This gives characteristics - just for one BAB.
2034      For actually saving/restoring a solution you need the actual solver one.
2035  */
2036  OsiBabSolver * solverCharacteristics_;
2037  /// Whether to force a resolve after takeOffCuts
2038  bool resolveAfterTakeOffCuts_;
2039#if NEW_UPDATE_OBJECT>1
2040  /// Number of outstanding update information items
2041  int numberUpdateItems_;
2042  /// Maximum number of outstanding update information items
2043  int maximumNumberUpdateItems_;
2044  /// Update items
2045  CbcObjectUpdateData * updateItems_;
2046#endif
2047  /**
2048     Parallel
2049     0 - off
2050     1 - testing
2051     2-99 threads
2052     other special meanings
2053  */
2054  int numberThreads_;
2055  /** thread mode
2056      always use numberThreads for branching
2057      1 set then use numberThreads in root mini branch and bound
2058      2 set then use numberThreads for root cuts
2059      default is 0
2060  */
2061  int threadMode_;
2062 //@}
2063};
2064/// So we can use osiObject or CbcObject during transition
2065void getIntegerInformation(const OsiObject * object, double & originalLower,
2066                           double & originalUpper) ;
2067// So we can call from other programs
2068// Real main program
2069class OsiClpSolverInterface;
2070int CbcMain (int argc, const char *argv[],OsiClpSolverInterface & solver,CbcModel ** babSolver);
2071int CbcMain (int argc, const char *argv[],CbcModel & babSolver);
2072// four ways of calling
2073int callCbc(const char * input2, OsiClpSolverInterface& solver1); 
2074int callCbc(const char * input2);
2075int callCbc(const std::string input2, OsiClpSolverInterface& solver1); 
2076int callCbc(const std::string input2) ;
2077// When we want to load up CbcModel with options first
2078void CbcMain0 (CbcModel & babSolver);
2079int CbcMain1 (int argc, const char *argv[],CbcModel & babSolver);
2080// two ways of calling
2081int callCbc(const char * input2, CbcModel & babSolver); 
2082int callCbc(const std::string input2, CbcModel & babSolver); 
2083// And when CbcMain0 already called to initialize
2084int callCbc1(const char * input2, CbcModel & babSolver); 
2085int callCbc1(const std::string input2, CbcModel & babSolver); 
2086// And when CbcMain0 already called to initialize (with call back) (see CbcMain1 for whereFrom)
2087int callCbc1(const char * input2, CbcModel & babSolver, int (CbcModel * currentSolver, int whereFrom)); 
2088int callCbc1(const std::string input2, CbcModel & babSolver, int (CbcModel * currentSolver, int whereFrom)); 
2089int CbcMain1 (int argc, const char *argv[],CbcModel & babSolver, int (CbcModel * currentSolver, int whereFrom));
2090#endif
Note: See TracBrowser for help on using the repository browser.