source: branches/sandbox/Cbc/src/CbcNode_stro.hpp @ 1286

Last change on this file since 1286 was 1286, checked in by EdwinStraver, 10 years ago

Changed formatting using AStyle -A4 -p

File size: 26.2 KB
Line 
1/* $Id: CbcNode.hpp 1271 2009-11-05 15:57:25Z forrest $ */
2// Copyright (C) 2002, International Business Machines
3// Corporation and others.  All Rights Reserved.
4#ifndef CbcNode_H
5#define CbcNode_H
6
7#include <string>
8#include <vector>
9
10#include "CoinWarmStartBasis.hpp"
11#include "CoinSearchTree.hpp"
12#include "CbcBranchBase.hpp"
13
14class OsiSolverInterface;
15class OsiSolverBranch;
16
17class OsiCuts;
18class OsiRowCut;
19class OsiRowCutDebugger;
20class CoinWarmStartBasis;
21class CbcCountRowCut;
22class CbcModel;
23class CbcNode;
24class CbcSubProblem;
25class CbcGeneralBranchingObject;
26
27//#############################################################################
28/** Information required to recreate the subproblem at this node
29
30  When a subproblem is initially created, it is represented by a CbcNode
31  object and an attached CbcNodeInfo object.
32
33  The CbcNode contains information needed while the subproblem remains live.
34  The CbcNode is deleted when the last branch arm has been evaluated.
35
36  The CbcNodeInfo contains information required to maintain the branch-and-cut
37  search tree structure (links and reference counts) and to recreate the
38  subproblem for this node (basis, variable bounds, cutting planes). A
39  CbcNodeInfo object remains in existence until all nodes have been pruned from
40  the subtree rooted at this node.
41
42  The principle used to maintain the reference count is that the reference
43  count is always the sum of all potential and actual children of the node.
44  Specifically,
45  <ul>
46    <li> Once it's determined how the node will branch, the reference count
47         is set to the number of potential children (<i>i.e.</i>, the number
48         of arms of the branch).
49    <li> As each child is created by CbcNode::branch() (converting a potential
50         child to the active subproblem), the reference count is decremented.
51    <li> If the child survives and will become a node in the search tree
52         (converting the active subproblem into an actual child), increment the
53         reference count.
54  </ul>
55  Notice that the active subproblem lives in a sort of limbo, neither a
56  potential or an actual node in the branch-and-cut tree.
57
58  CbcNodeInfo objects come in two flavours. A CbcFullNodeInfo object contains
59  a full record of the information required to recreate a subproblem.
60  A CbcPartialNodeInfo object expresses this information in terms of
61  differences from the parent.
62*/
63
64class CbcNodeInfo {
65
66public:
67
68    /** \name Constructors & destructors */
69//@{
70    /** Default Constructor
71
72      Creates an empty NodeInfo object.
73    */
74    CbcNodeInfo ();
75
76    /// Copy constructor
77    CbcNodeInfo ( const CbcNodeInfo &);
78
79#if 0
80    /** Construct with parent
81
82      Creates a NodeInfo object which knows its parent and assumes it will
83      in turn have two children.
84    */
85    CbcNodeInfo (CbcNodeInfo * parent);
86#endif
87
88    /** Construct with parent and owner
89
90      As for `construct with parent', and attached to \p owner.
91    */
92    CbcNodeInfo (CbcNodeInfo * parent, CbcNode * owner);
93
94    /** Destructor
95
96      Note that the destructor will recursively delete the parent if this
97      nodeInfo is the last child.
98    */
99    virtual ~CbcNodeInfo();
100//@}
101
102
103    /** \brief Modify model according to information at node
104
105        The routine modifies the model according to bound and basis
106        information at node and adds any cuts to the addCuts array.
107    */
108    virtual void applyToModel (CbcModel *model, CoinWarmStartBasis *&basis,
109                               CbcCountRowCut **addCuts,
110                               int &currentNumberCuts) const = 0 ;
111    /// Just apply bounds to one variable - force means overwrite by lower,upper (1=>infeasible)
112    virtual int applyBounds(int iColumn, double & lower, double & upper, int force) = 0;
113
114    /** Builds up row basis backwards (until original model).
115        Returns NULL or previous one to apply .
116        Depends on Free being 0 and impossible for cuts
117    */
118    virtual CbcNodeInfo * buildRowBasis(CoinWarmStartBasis & basis) const = 0;
119    /// Clone
120    virtual CbcNodeInfo * clone() const = 0;
121    /// Called when number branches left down to zero
122    virtual void allBranchesGone() {}
123#if 1
124    /// Increment number of references
125    inline void increment(int amount = 1) {
126        numberPointingToThis_ += amount;/*printf("CbcNodeInfo %x incremented by %d to %d\n",this,amount,numberPointingToThis_);*/
127    }
128
129    /// Decrement number of references and return number left
130    inline int decrement(int amount = 1) {
131        numberPointingToThis_ -= amount;/*printf("CbcNodeInfo %x decremented by %d to %d\n",this,amount,numberPointingToThis_);*/
132        return numberPointingToThis_;
133    }
134#else
135    /// Increment number of references
136    void increment(int amount = 1);
137    /// Decrement number of references and return number left
138    int decrement(int amount = 1);
139#endif
140    /** Initialize reference counts
141
142      Initialize the reference counts used for tree maintenance.
143    */
144
145    inline void initializeInfo(int number) {
146        numberPointingToThis_ = number;
147        numberBranchesLeft_ = number;
148    }
149
150    /// Return number of branches left in object
151    inline int numberBranchesLeft() const {
152        return numberBranchesLeft_;
153    }
154
155    /// Set number of branches left in object
156    inline void setNumberBranchesLeft(int value) {
157        numberBranchesLeft_ = value;
158    }
159
160    /// Return number of objects pointing to this
161    inline int numberPointingToThis() const {
162        return numberPointingToThis_;
163    }
164
165    /// Set number of objects pointing to this
166    inline void setNumberPointingToThis(int number) {
167        numberPointingToThis_ = number;
168    }
169
170    /// Increment number of objects pointing to this
171    inline void incrementNumberPointingToThis() {
172        numberPointingToThis_ ++;
173    }
174
175    /// Say one branch taken
176    inline int branchedOn() {
177        numberPointingToThis_--;
178        numberBranchesLeft_--;
179        return numberBranchesLeft_;
180    }
181
182    /// Say thrown away
183    inline void throwAway() {
184        numberPointingToThis_ -= numberBranchesLeft_;
185        numberBranchesLeft_ = 0;
186    }
187
188    /// Parent of this
189    CbcNodeInfo * parent() const {
190        return parent_;
191    }
192    /// Set parent null
193    inline void nullParent() {
194        parent_ = NULL;
195    }
196
197    void addCuts(OsiCuts & cuts, int numberToBranch, //int * whichGenerator,
198                 int numberPointingToThis);
199    void addCuts(int numberCuts, CbcCountRowCut ** cuts, int numberToBranch);
200    /** Delete cuts (decrements counts)
201        Slow unless cuts in same order as saved
202    */
203    void deleteCuts(int numberToDelete, CbcCountRowCut ** cuts);
204    void deleteCuts(int numberToDelete, int * which);
205
206    /// Really delete a cut
207    void deleteCut(int whichOne);
208
209    /// Decrement active cut counts
210    void decrementCuts(int change = 1);
211
212    /// Increment active cut counts
213    void incrementCuts(int change = 1);
214
215    /// Decrement all active cut counts in chain starting at parent
216    void decrementParentCuts(CbcModel * model, int change = 1);
217
218    /// Increment all active cut counts in parent chain
219    void incrementParentCuts(CbcModel * model, int change = 1);
220
221    /// Array of pointers to cuts
222    inline CbcCountRowCut ** cuts() const {
223        return cuts_;
224    }
225
226    /// Number of row cuts (this node)
227    inline int numberCuts() const {
228        return numberCuts_;
229    }
230    inline void setNumberCuts(int value) {
231        numberCuts_ = value;
232    }
233
234    /// Set owner null
235    inline void nullOwner() {
236        owner_ = NULL;
237    }
238    const inline CbcNode * owner() const {
239        return owner_;
240    }
241    inline CbcNode * mutableOwner() const {
242        return owner_;
243    }
244    /// The node number
245    inline int nodeNumber() const {
246        return nodeNumber_;
247    }
248    inline void setNodeNumber(int node) {
249        nodeNumber_ = node;
250    }
251    /** Deactivate node information.
252        1 - bounds
253        2 - cuts
254        4 - basis!
255    */
256    void deactivate(int mode = 3);
257    /// Say if normal
258    inline bool allActivated() const {
259        return (active_ == 7);
260    }
261    /// Say if marked
262    inline bool marked() const {
263        return ((active_&8) != 0);
264    }
265    /// Mark
266    inline void mark() {
267        active_ |= 8;
268    }
269    /// Unmark
270    inline void unmark() {
271        active_ &= ~8;
272    }
273
274    /// Branching object for the parent
275    inline const OsiBranchingObject * parentBranch() const {
276        return parentBranch_;
277    }
278    /// If we need to take off parent based data
279    void unsetParentBasedData();
280protected:
281
282    /** Number of other nodes pointing to this node.
283
284      Number of existing and potential search tree nodes pointing to this node.
285      `Existing' means referenced by #parent_ of some other CbcNodeInfo.
286      `Potential' means children still to be created (#numberBranchesLeft_ of
287      this CbcNodeInfo).
288    */
289    int numberPointingToThis_;
290
291    /// parent
292    CbcNodeInfo * parent_;
293
294    /// Copy of the branching object of the parent when the node is created
295    OsiBranchingObject * parentBranch_;
296
297    /// Owner
298    CbcNode * owner_;
299
300    /// Number of row cuts (this node)
301    int numberCuts_;
302
303    /// The node number
304    int nodeNumber_;
305
306    /// Array of pointers to cuts
307    CbcCountRowCut ** cuts_;
308
309    /** Number of rows in problem (before these cuts).  This
310        means that for top of chain it must be rows at continuous */
311    int numberRows_;
312
313    /** Number of branch arms left to explore at this node
314
315      \todo There seems to be redundancy between this field and
316        CbcBranchingObject::numberBranchesLeft_. It'd be good to sort out if
317        both are necessary.
318    */
319    int numberBranchesLeft_;
320    /** Active node information.
321        1 - bounds
322        2 - cuts
323        4 - basis!
324    */
325    int active_;
326
327private:
328
329    /// Illegal Assignment operator
330    CbcNodeInfo & operator=(const CbcNodeInfo& rhs);
331
332    /// routine common to constructors
333    void setParentBasedData();
334};
335
336/** \brief Holds complete information for recreating a subproblem.
337
338  A CbcFullNodeInfo object contains all necessary information (bounds, basis,
339  and cuts) required to recreate a subproblem.
340
341  \todo While there's no explicit statement, the code often makes the implicit
342        assumption that an CbcFullNodeInfo structure will appear only at the
343        root node of the search tree. Things will break if this assumption
344        is violated.
345*/
346
347class CbcFullNodeInfo : public CbcNodeInfo {
348
349public:
350
351    /** \brief Modify model according to information at node
352
353        The routine modifies the model according to bound information at node,
354        creates a new basis according to information at node, but with the size
355        passed in through basis, and adds any cuts to the addCuts array.
356
357      \note The basis passed in via basis is solely a vehicle for passing in
358        the desired basis size. It will be deleted and a new basis returned.
359    */
360    virtual void applyToModel (CbcModel *model, CoinWarmStartBasis *&basis,
361                               CbcCountRowCut **addCuts,
362                               int &currentNumberCuts) const ;
363
364    /// Just apply bounds to one variable - force means overwrite by lower,upper (1=>infeasible)
365    virtual int applyBounds(int iColumn, double & lower, double & upper, int force) ;
366
367    /** Builds up row basis backwards (until original model).
368        Returns NULL or previous one to apply .
369        Depends on Free being 0 and impossible for cuts
370    */
371    virtual CbcNodeInfo * buildRowBasis(CoinWarmStartBasis & basis) const ;
372    // Default Constructor
373    CbcFullNodeInfo ();
374
375    /** Constructor from continuous or satisfied
376    */
377    CbcFullNodeInfo (CbcModel * model,
378                     int numberRowsAtContinuous);
379
380    // Copy constructor
381    CbcFullNodeInfo ( const CbcFullNodeInfo &);
382
383    // Destructor
384    ~CbcFullNodeInfo ();
385
386    /// Clone
387    virtual CbcNodeInfo * clone() const;
388    /// Lower bounds
389    inline const double * lower() const {
390        return lower_;
391    }
392    /// Upper bounds
393    inline const double * upper() const {
394        return upper_;
395    }
396protected:
397    // Data
398    /** Full basis
399
400      This MUST BE A POINTER to avoid cutting extra information in derived
401      warm start classes.
402    */
403    CoinWarmStartBasis *basis_;
404    int numberIntegers_;
405    // Bounds stored in full
406    double * lower_;
407    double * upper_;
408private:
409    /// Illegal Assignment operator
410    CbcFullNodeInfo & operator=(const CbcFullNodeInfo& rhs);
411};
412
413
414
415/** \brief Holds information for recreating a subproblem by incremental change
416           from the parent.
417
418  A CbcPartialNodeInfo object contains changes to the bounds and basis, and
419  additional cuts, required to recreate a subproblem by modifying and
420  augmenting the parent subproblem.
421*/
422
423class CbcPartialNodeInfo : public CbcNodeInfo {
424
425public:
426
427    /** \brief Modify model according to information at node
428
429        The routine modifies the model according to bound and basis change
430        information at node and adds any cuts to the addCuts array.
431    */
432    virtual void applyToModel (CbcModel *model, CoinWarmStartBasis *&basis,
433                               CbcCountRowCut **addCuts,
434                               int &currentNumberCuts) const ;
435
436    /// Just apply bounds to one variable - force means overwrite by lower,upper (1=>infeasible)
437    virtual int applyBounds(int iColumn, double & lower, double & upper, int force) ;
438    /** Builds up row basis backwards (until original model).
439        Returns NULL or previous one to apply .
440        Depends on Free being 0 and impossible for cuts
441    */
442    virtual CbcNodeInfo * buildRowBasis(CoinWarmStartBasis & basis ) const ;
443    // Default Constructor
444    CbcPartialNodeInfo ();
445
446    // Constructor from current state
447    CbcPartialNodeInfo (CbcNodeInfo * parent, CbcNode * owner,
448                        int numberChangedBounds, const int * variables,
449                        const double * boundChanges,
450                        const CoinWarmStartDiff *basisDiff) ;
451
452    // Copy constructor
453    CbcPartialNodeInfo ( const CbcPartialNodeInfo &);
454
455    // Destructor
456    ~CbcPartialNodeInfo ();
457
458    /// Clone
459    virtual CbcNodeInfo * clone() const;
460    /// Basis diff information
461    inline const CoinWarmStartDiff *basisDiff() const {
462        return basisDiff_ ;
463    }
464    /// Which variable (top bit if upper bound changing)
465    inline const int * variables() const {
466        return variables_;
467    }
468    // New bound
469    inline const double * newBounds() const {
470        return newBounds_;
471    }
472    /// Number of bound changes
473    inline int numberChangedBounds() const {
474        return numberChangedBounds_;
475    }
476protected:
477    /* Data values */
478
479    /// Basis diff information
480    CoinWarmStartDiff *basisDiff_ ;
481    /// Which variable (top bit if upper bound changing)
482    int * variables_;
483    // New bound
484    double * newBounds_;
485    /// Number of bound changes
486    int numberChangedBounds_;
487private:
488
489    /// Illegal Assignment operator
490    CbcPartialNodeInfo & operator=(const CbcPartialNodeInfo& rhs);
491};
492
493
494/** Information required while the node is live
495
496  When a subproblem is initially created, it is represented by an CbcNode
497  object and an attached CbcNodeInfo object.
498
499  The CbcNode contains information (depth, branching instructions), that's
500  needed while the subproblem remains `live', <i>i.e.</i>, while the
501  subproblem is not fathomed and there are branch arms still be be
502  evaluated.  The CbcNode is deleted when the last branch arm has been
503  evaluated.
504
505  The CbcNodeInfo object contains the information needed to maintain the
506  search tree and recreate the subproblem for the node. It remains in
507  existence until there are no nodes remaining in the subtree rooted at this
508  node.
509*/
510
511class CbcNode : public CoinTreeNode {
512
513public:
514
515    /// Default Constructor
516    CbcNode ();
517
518    /// Construct and increment parent reference count
519    CbcNode (CbcModel * model, CbcNode * lastNode);
520
521    /// Copy constructor
522    CbcNode (const CbcNode &);
523
524    /// Assignment operator
525    CbcNode & operator= (const CbcNode& rhs);
526
527    /// Destructor
528    ~CbcNode ();
529
530    /** Create a description of the subproblem at this node
531
532      The CbcNodeInfo structure holds the information (basis & variable bounds)
533      required to recreate the subproblem for this node. It also links the node
534      to its parent (via the parent's CbcNodeInfo object).
535
536      If lastNode == NULL, a CbcFullNodeInfo object will be created. All
537      parameters except \p model are unused.
538
539      If lastNode != NULL, a CbcPartialNodeInfo object will be created. Basis and
540      bounds information will be stored in the form of differences between the
541      parent subproblem and this subproblem.
542      (More precisely, \p lastws, \p lastUpper, \p lastLower,
543      \p numberOldActiveCuts, and \p numberNewCuts are used.)
544    */
545    void
546    createInfo(CbcModel * model,
547               CbcNode * lastNode,
548               const CoinWarmStartBasis *lastws,
549               const double * lastLower, const double * lastUpper,
550               int numberOldActiveCuts, int numberNewCuts);
551
552    /** Create a branching object for the node
553
554      The routine scans the object list of the model and selects a set of
555      unsatisfied objects as candidates for branching. The candidates are
556      evaluated, and an appropriate branch object is installed.
557
558      The numberPassesLeft is decremented to stop fixing one variable each time
559      and going on and on (e.g. for stock cutting, air crew scheduling)
560
561      If evaluation determines that an object is monotone or infeasible,
562      the routine returns immediately. In the case of a monotone object,
563      the branch object has already been called to modify the model.
564
565      Return value:
566      <ul>
567        <li>  0: A branching object has been installed
568        <li> -1: A monotone object was discovered
569        <li> -2: An infeasible object was discovered
570      </ul>
571    */
572    int chooseBranch (CbcModel * model,
573                      CbcNode * lastNode,
574                      int numberPassesLeft);
575    /** Create a branching object for the node - when dynamic pseudo costs
576
577      The routine scans the object list of the model and selects a set of
578      unsatisfied objects as candidates for branching. The candidates are
579      evaluated, and an appropriate branch object is installed.
580      This version gives preference in evaluation to variables which
581      have not been evaluated many times.  It also uses numberStrong
582      to say give up if last few tries have not changed incumbent.
583      See Achterberg, Koch and Martin.
584
585      The numberPassesLeft is decremented to stop fixing one variable each time
586      and going on and on (e.g. for stock cutting, air crew scheduling)
587
588      If evaluation determines that an object is monotone or infeasible,
589      the routine returns immediately. In the case of a monotone object,
590      the branch object has already been called to modify the model.
591
592      Return value:
593      <ul>
594        <li>  0: A branching object has been installed
595        <li> -1: A monotone object was discovered
596        <li> -2: An infeasible object was discovered
597        <li> >0: Number of quich branching objects (and branches will be non NULL)
598      </ul>
599    */
600    int chooseDynamicBranch (CbcModel * model,
601                             CbcNode * lastNode,
602                             OsiSolverBranch * & branches,
603                             int numberPassesLeft);
604    /** Create a branching object for the node
605
606      The routine scans the object list of the model and selects a set of
607      unsatisfied objects as candidates for branching. The candidates are
608      evaluated, and an appropriate branch object is installed.
609
610      The numberPassesLeft is decremented to stop fixing one variable each time
611      and going on and on (e.g. for stock cutting, air crew scheduling)
612
613      If evaluation determines that an object is monotone or infeasible,
614      the routine returns immediately. In the case of a monotone object,
615      the branch object has already been called to modify the model.
616
617      Return value:
618      <ul>
619        <li>  0: A branching object has been installed
620        <li> -1: A monotone object was discovered
621        <li> -2: An infeasible object was discovered
622      </ul>
623      Branch state:
624      <ul>
625        <li> -1: start
626        <li> -1: A monotone object was discovered
627        <li> -2: An infeasible object was discovered
628      </ul>
629    */
630    int chooseOsiBranch (CbcModel * model,
631                         CbcNode * lastNode,
632                         OsiBranchingInformation * usefulInfo,
633                         int branchState);
634    /** Create a branching object for the node
635
636      The routine scans the object list of the model and selects a set of
637      unsatisfied objects as candidates for branching. It then solves a
638      series of problems and a CbcGeneral branch object is installed.
639
640      If evaluation determines that an object is infeasible,
641      the routine returns immediately.
642
643      Return value:
644      <ul>
645        <li>  0: A branching object has been installed
646        <li> -2: An infeasible object was discovered
647      </ul>
648    */
649    int chooseClpBranch (CbcModel * model,
650                         CbcNode * lastNode);
651    int analyze(CbcModel * model, double * results);
652    /// Decrement active cut counts
653    void decrementCuts(int change = 1);
654
655    /// Decrement all active cut counts in chain starting at parent
656    void decrementParentCuts(CbcModel * model, int change = 1);
657
658    /// Nulls out node info
659    void nullNodeInfo();
660    /** Initialize reference counts in attached CbcNodeInfo
661
662      This is a convenience routine, which will initialize the reference counts
663      in the attached CbcNodeInfo object based on the attached
664      OsiBranchingObject.
665
666      \sa CbcNodeInfo::initializeInfo(int).
667    */
668    void initializeInfo();
669
670    /// Does next branch and updates state
671    int branch(OsiSolverInterface * solver);
672
673    /** Double checks in case node can change its mind!
674        Returns objective value
675        Can change objective etc */
676    double checkIsCutoff(double cutoff);
677    // Information to make basis and bounds
678    inline CbcNodeInfo * nodeInfo() const {
679        return nodeInfo_;
680    }
681
682    // Objective value
683    inline double objectiveValue() const {
684        return objectiveValue_;
685    }
686    inline void setObjectiveValue(double value) {
687        objectiveValue_ = value;
688    }
689    /// Number of arms defined for the attached OsiBranchingObject.
690    inline int numberBranches() const {
691        if (branch_)
692            return (branch_->numberBranches()) ;
693        else
694            return (-1) ;
695    }
696
697    /* Active arm of the attached OsiBranchingObject.
698
699     In the simplest instance, coded -1 for the down arm of the branch, +1 for
700     the up arm. But see OsiBranchingObject::way()
701       Use nodeInfo--.numberBranchesLeft_ to see how active
702    */
703    int way() const;
704    /// Depth in branch-and-cut search tree
705    inline int depth() const {
706        return depth_;
707    }
708    /// Set depth in branch-and-cut search tree
709    inline void setDepth(int value) {
710        depth_ = value;
711    }
712    /// Get the number of objects unsatisfied at this node.
713    inline int numberUnsatisfied() const {
714        return numberUnsatisfied_;
715    }
716    /// Set the number of objects unsatisfied at this node.
717    inline void setNumberUnsatisfied(int value) {
718        numberUnsatisfied_ = value;
719    }
720    /// Get sum of "infeasibilities" reported by each object
721    inline double sumInfeasibilities() const {
722        return sumInfeasibilities_;
723    }
724    /// Set sum of "infeasibilities" reported by each object
725    inline void setSumInfeasibilities(double value) {
726        sumInfeasibilities_ = value;
727    }
728    // Guessed objective value (for solution)
729    inline double guessedObjectiveValue() const {
730        return guessedObjectiveValue_;
731    }
732    inline void setGuessedObjectiveValue(double value) {
733        guessedObjectiveValue_ = value;
734    }
735    /// Branching object for this node
736    inline const OsiBranchingObject * branchingObject() const {
737        return branch_;
738    }
739    /// Modifiable branching object for this node
740    inline OsiBranchingObject * modifiableBranchingObject() const {
741        return branch_;
742    }
743    /// Set branching object for this node (takes ownership)
744    inline void setBranchingObject(OsiBranchingObject * branchingObject) {
745        branch_ = branchingObject;
746    }
747    /// The node number
748    inline int nodeNumber() const {
749        return nodeNumber_;
750    }
751    inline void setNodeNumber(int node) {
752        nodeNumber_ = node;
753    }
754    /// Returns true if on tree
755    inline bool onTree() const {
756        return (state_&1) != 0;
757    }
758    /// Sets true if on tree
759    inline void setOnTree(bool yesNo) {
760        if (yesNo) state_ |= 1;
761        else state_ &= ~1;
762    }
763    /// Returns true if active
764    inline bool active() const {
765        return (state_&2) != 0;
766    }
767    /// Sets true if active
768    inline void setActive(bool yesNo) {
769        if (yesNo) state_ |= 2;
770        else state_ &= ~2;
771    }
772    /// Print
773    void print() const;
774    /// Debug
775    inline void checkInfo() const {
776        assert (nodeInfo_->numberBranchesLeft() ==
777                branch_->numberBranchesLeft());
778    }
779
780private:
781    // Data
782    /// Information to make basis and bounds
783    CbcNodeInfo * nodeInfo_;
784    /// Objective value
785    double objectiveValue_;
786    /// Guessed satisfied Objective value
787    double guessedObjectiveValue_;
788    /// Sum of "infeasibilities" reported by each object
789    double sumInfeasibilities_;
790    /// Branching object for this node
791    OsiBranchingObject * branch_;
792    /// Depth of the node in the search tree
793    int depth_;
794    /// The number of objects unsatisfied at this node.
795    int numberUnsatisfied_;
796    /// The node number
797    int nodeNumber_;
798    /** State
799        1 - on tree
800        2 - active
801    */
802    int state_;
803};
804
805
806#endif
Note: See TracBrowser for help on using the repository browser.