source: trunk/Cbc/src/CbcBranchingObject.cpp @ 2464

Last change on this file since 2464 was 2464, checked in by unxusr, 6 months ago

.clang-format with proposal for formatting code

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
RevLine 
[1573]1// $Id: CbcBranchingObject.cpp 2464 2019-01-03 19:03:23Z unxusr $
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
[1357]6// Edwin 11/12/2009 carved from CbcBranchBase
[1573]7
[1357]8#if defined(_MSC_VER)
9// Turn off compiler warning about long names
[2464]10#pragma warning(disable : 4786)
[1357]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
24// Default Constructor
25CbcBranchingObject::CbcBranchingObject()
[2464]26  : OsiBranchingObject()
[1357]27{
[2464]28  model_ = NULL;
29  originalCbcObject_ = NULL;
30  variable_ = -1;
31  way_ = 0;
[1357]32}
33
34// Useful constructor
[2464]35CbcBranchingObject::CbcBranchingObject(CbcModel *model, int variable, int way, double value)
36  : OsiBranchingObject(model->solver(), value)
[1357]37{
[2464]38  model_ = model;
39  originalCbcObject_ = NULL;
40  variable_ = variable;
41  way_ = way;
[1357]42}
43
44// Copy constructor
[2464]45CbcBranchingObject::CbcBranchingObject(const CbcBranchingObject &rhs)
46  : OsiBranchingObject(rhs)
[1357]47{
[2464]48  model_ = rhs.model_;
49  originalCbcObject_ = rhs.originalCbcObject_;
50  variable_ = rhs.variable_;
51  way_ = rhs.way_;
52  value_ = rhs.value_;
[1357]53}
54
55// Assignment operator
56CbcBranchingObject &
[2464]57CbcBranchingObject::operator=(const CbcBranchingObject &rhs)
[1357]58{
[2464]59  if (this != &rhs) {
60    OsiBranchingObject::operator=(rhs);
61    model_ = rhs.model_;
62    originalCbcObject_ = rhs.originalCbcObject_;
63    variable_ = rhs.variable_;
64    way_ = rhs.way_;
65  }
66  return *this;
[1357]67}
68
69// Destructor
[2464]70CbcBranchingObject::~CbcBranchingObject()
[1357]71{
72}
Note: See TracBrowser for help on using the repository browser.