1 // $Id$
2 // Copyright (C) 2002, International Business Machines
3 // Corporation and others.  All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 // Edwin 11/12/2009 carved from CbcBranchBase
7 
8 #if defined(_MSC_VER)
9 // Turn off compiler warning about long names
10 #pragma warning(disable : 4786)
11 #endif
12 #include <cassert>
13 #include <cstdlib>
14 #include <cmath>
15 #include <cfloat>
16 
17 #include "OsiSolverInterface.hpp"
18 #include "OsiSolverBranch.hpp"
19 #include "OsiChooseVariable.hpp"
20 #include "CbcModel.hpp"
21 #include "CbcMessage.hpp"
22 #include "CbcBranchBase.hpp"
23 #include "CbcObjectUpdateData.hpp"
24 
25 // Default constructor
CbcObjectUpdateData()26 CbcObjectUpdateData::CbcObjectUpdateData()
27   : object_(NULL)
28   , way_(0)
29   , objectNumber_(-1)
30   , change_(0.0)
31   , status_(0)
32   , intDecrease_(0)
33   , branchingValue_(0.0)
34   , originalObjective_(COIN_DBL_MAX)
35   , cutoff_(COIN_DBL_MAX)
36 {
37 }
38 
39 // Useful constructor
CbcObjectUpdateData(CbcObject * object,int way,double change,int status,int intDecrease,double branchingValue)40 CbcObjectUpdateData::CbcObjectUpdateData(CbcObject *object,
41   int way,
42   double change,
43   int status,
44   int intDecrease,
45   double branchingValue)
46   : object_(object)
47   , way_(way)
48   , objectNumber_(-1)
49   , change_(change)
50   , status_(status)
51   , intDecrease_(intDecrease)
52   , branchingValue_(branchingValue)
53   , originalObjective_(COIN_DBL_MAX)
54   , cutoff_(COIN_DBL_MAX)
55 {
56 }
57 
58 // Destructor
~CbcObjectUpdateData()59 CbcObjectUpdateData::~CbcObjectUpdateData()
60 {
61 }
62 
63 // Copy constructor
CbcObjectUpdateData(const CbcObjectUpdateData & rhs)64 CbcObjectUpdateData::CbcObjectUpdateData(const CbcObjectUpdateData &rhs)
65   : object_(rhs.object_)
66   , way_(rhs.way_)
67   , objectNumber_(rhs.objectNumber_)
68   , change_(rhs.change_)
69   , status_(rhs.status_)
70   , intDecrease_(rhs.intDecrease_)
71   , branchingValue_(rhs.branchingValue_)
72   , originalObjective_(rhs.originalObjective_)
73   , cutoff_(rhs.cutoff_)
74 {
75 }
76 
77 // Assignment operator
78 CbcObjectUpdateData &
operator =(const CbcObjectUpdateData & rhs)79 CbcObjectUpdateData::operator=(const CbcObjectUpdateData &rhs)
80 {
81   if (this != &rhs) {
82     object_ = rhs.object_;
83     way_ = rhs.way_;
84     objectNumber_ = rhs.objectNumber_;
85     change_ = rhs.change_;
86     status_ = rhs.status_;
87     intDecrease_ = rhs.intDecrease_;
88     branchingValue_ = rhs.branchingValue_;
89     originalObjective_ = rhs.originalObjective_;
90     cutoff_ = rhs.cutoff_;
91   }
92   return *this;
93 }
94 
95 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
96 */
97