source: branches/devel/Cbc/src/CbcCountRowCut.cpp @ 539

Last change on this file since 539 was 310, checked in by andreasw, 14 years ago

first commit for autotools conversion to be able to move more files

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1// Copyright (C) 2002, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#if defined(_MSC_VER)
4// Turn off compiler warning about long names
5#  pragma warning(disable:4786)
6#endif
7#include <cassert>
8
9#include "OsiRowCut.hpp"
10#include "CbcCountRowCut.hpp"
11#include "CbcNode.hpp"
12// Default Constructor
13CbcCountRowCut::CbcCountRowCut ()
14  :
15  OsiRowCut(),
16  owner_(NULL),
17  ownerCut_(-1),
18  numberPointingToThis_(0),
19  whichCutGenerator_(-1)
20{
21#ifdef CHECK_CUT_COUNTS
22  printf("CbcCountRowCut default constructor %x\n",this);
23#endif
24}
25   
26// Copy Constructor
27CbcCountRowCut::CbcCountRowCut (const OsiRowCut & rhs)
28  : OsiRowCut(rhs),
29    owner_(NULL),
30    ownerCut_(-1),
31    numberPointingToThis_(0),
32    whichCutGenerator_(-1)
33{
34#ifdef CHECK_CUT_COUNTS
35  printf("CbcCountRowCut constructor %x from RowCut\n",this);
36#endif
37}
38// Copy Constructor
39CbcCountRowCut::CbcCountRowCut (const OsiRowCut & rhs,
40                                CbcNodeInfo * info, int whichOne,
41                                int whichGenerator)
42  : OsiRowCut(rhs),
43  owner_(info),
44  ownerCut_(whichOne),
45    numberPointingToThis_(0),
46  whichCutGenerator_(whichGenerator)
47{
48#ifdef CHECK_CUT_COUNTS
49  printf("CbcCountRowCut constructor %x from RowCut and info\n",this);
50#endif
51}
52CbcCountRowCut::~CbcCountRowCut()
53{
54#ifdef CHECK_CUT_COUNTS
55  printf("CbcCountRowCut destructor %x - references %d\n",this,
56         numberPointingToThis_);
57#endif
58  // Look at owner and delete
59  owner_->deleteCut(ownerCut_);
60}
61// Increment number of references
62void 
63CbcCountRowCut::increment(int change)
64{
65  numberPointingToThis_+=change;
66}
67
68// Decrement number of references and return number left
69int 
70CbcCountRowCut::decrement(int change)
71{
72  assert(numberPointingToThis_>=change);
73  numberPointingToThis_-=change;
74  return numberPointingToThis_;
75}
76// Set information
77void 
78CbcCountRowCut::setInfo(CbcNodeInfo * info, int whichOne)
79{
80  owner_=info;
81  ownerCut_=whichOne;
82}
83
Note: See TracBrowser for help on using the repository browser.