source: trunk/Cbc/src/CbcDummyBranchingObject.cpp

Last change on this file was 2465, checked in by unxusr, 9 months ago

script to format sources

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1// $Id: CbcDummyBranchingObject.cpp 2465 2019-01-03 19:26:52Z stefan $
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/10/2009-- carved out of CbcBranchActual
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//#define CBC_DEBUG
17
18#include "CoinTypes.hpp"
19#include "OsiSolverInterface.hpp"
20#include "OsiSolverBranch.hpp"
21#include "CbcModel.hpp"
22#include "CbcMessage.hpp"
23#include "CbcDummyBranchingObject.hpp"
24#include "CbcBranchActual.hpp"
25#include "CoinSort.hpp"
26#include "CoinError.hpp"
27
28//##############################################################################
29
30// Default Constructor
31CbcDummyBranchingObject::CbcDummyBranchingObject(CbcModel *model)
32  : CbcBranchingObject(model, 0, 0, 0.5)
33{
34  setNumberBranchesLeft(1);
35}
36
37// Copy constructor
38CbcDummyBranchingObject::CbcDummyBranchingObject(const CbcDummyBranchingObject &rhs)
39  : CbcBranchingObject(rhs)
40{
41}
42
43// Assignment operator
44CbcDummyBranchingObject &
45CbcDummyBranchingObject::operator=(const CbcDummyBranchingObject &rhs)
46{
47  if (this != &rhs) {
48    CbcBranchingObject::operator=(rhs);
49  }
50  return *this;
51}
52CbcBranchingObject *
53CbcDummyBranchingObject::clone() const
54{
55  return (new CbcDummyBranchingObject(*this));
56}
57
58// Destructor
59CbcDummyBranchingObject::~CbcDummyBranchingObject()
60{
61}
62
63/*
64  Perform a dummy branch
65*/
66double
67CbcDummyBranchingObject::branch()
68{
69  decrementNumberBranchesLeft();
70  return 0.0;
71}
72// Print what would happen
73void CbcDummyBranchingObject::print()
74{
75  printf("Dummy branch\n");
76}
77/** Compare the original object of \c this with the original object of \c
78    brObj. Assumes that there is an ordering of the original objects.
79    This method should be invoked only if \c this and brObj are of the same
80    type.
81    Return negative/0/positive depending on whether \c this is
82    smaller/same/larger than the argument.
83*/
84int CbcDummyBranchingObject::compareOriginalObject(const CbcBranchingObject * /*brObj*/) const
85{
86  throw("must implement");
87}
88
89/** Compare the \c this with \c brObj. \c this and \c brObj must be os the
90    same type and must have the same original object, but they may have
91    different feasible regions.
92    Return the appropriate CbcRangeCompare value (first argument being the
93    sub/superset if that's the case). In case of overlap (and if \c
94    replaceIfOverlap is true) replace the current branching object with one
95    whose feasible region is the overlap.
96*/
97CbcRangeCompare
98CbcDummyBranchingObject::compareBranchingObject(const CbcBranchingObject * /*brObj*/, const bool /*replaceIfOverlap*/)
99{
100  throw("must implement");
101}
102
103/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
104*/
Note: See TracBrowser for help on using the repository browser.