source: trunk/Cbc/src/CbcDummyBranchingObject.cpp @ 1899

Last change on this file since 1899 was 1899, checked in by stefan, 6 years ago

fixup svn properties

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1// $Id: CbcDummyBranchingObject.cpp 1899 2013-04-09 18:12:08Z 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
38// Copy constructor
39CbcDummyBranchingObject::CbcDummyBranchingObject ( const CbcDummyBranchingObject & rhs) : 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
59// Destructor
60CbcDummyBranchingObject::~CbcDummyBranchingObject ()
61{
62}
63
64/*
65  Perform a dummy branch
66*/
67double
68CbcDummyBranchingObject::branch()
69{
70    decrementNumberBranchesLeft();
71    return 0.0;
72}
73// Print what would happen
74void
75CbcDummyBranchingObject::print()
76{
77    printf("Dummy branch\n");
78}
79/** Compare the original object of \c this with the original object of \c
80    brObj. Assumes that there is an ordering of the original objects.
81    This method should be invoked only if \c this and brObj are of the same
82    type.
83    Return negative/0/positive depending on whether \c this is
84    smaller/same/larger than the argument.
85*/
86int
87CbcDummyBranchingObject::compareOriginalObject
88(const CbcBranchingObject* /*brObj*/) const
89{
90    throw("must implement");
91}
92
93/** Compare the \c this with \c brObj. \c this and \c brObj must be os the
94    same type and must have the same original object, but they may have
95    different feasible regions.
96    Return the appropriate CbcRangeCompare value (first argument being the
97    sub/superset if that's the case). In case of overlap (and if \c
98    replaceIfOverlap is true) replace the current branching object with one
99    whose feasible region is the overlap.
100*/
101CbcRangeCompare
102CbcDummyBranchingObject::compareBranchingObject
103(const CbcBranchingObject* /*brObj*/, const bool /*replaceIfOverlap*/)
104{
105    throw("must implement");
106}
107
Note: See TracBrowser for help on using the repository browser.