source: stable/2.5/Cbc/src/CbcDummyBranchingObject.cpp @ 1510

Last change on this file since 1510 was 1357, checked in by coin, 10 years ago

run 'astyle -A4 -p' and dos2unix

File size: 2.6 KB
Line 
1// Edwin 11/10/2009-- carved out of CbcBranchActual
2#if defined(_MSC_VER)
3// Turn off compiler warning about long names
4#  pragma warning(disable:4786)
5#endif
6#include <cassert>
7#include <cstdlib>
8#include <cmath>
9#include <cfloat>
10//#define CBC_DEBUG
11
12#include "CoinTypes.hpp"
13#include "OsiSolverInterface.hpp"
14#include "OsiSolverBranch.hpp"
15#include "CbcModel.hpp"
16#include "CbcMessage.hpp"
17#include "CbcDummyBranchingObject.hpp"
18#include "CbcBranchActual.hpp"
19#include "CoinSort.hpp"
20#include "CoinError.hpp"
21
22//##############################################################################
23
24// Default Constructor
25CbcDummyBranchingObject::CbcDummyBranchingObject(CbcModel * model)
26        : CbcBranchingObject(model, 0, 0, 0.5)
27{
28    setNumberBranchesLeft(1);
29}
30
31
32// Copy constructor
33CbcDummyBranchingObject::CbcDummyBranchingObject ( const CbcDummyBranchingObject & rhs) : CbcBranchingObject(rhs)
34{
35}
36
37// Assignment operator
38CbcDummyBranchingObject &
39CbcDummyBranchingObject::operator=( const CbcDummyBranchingObject & rhs)
40{
41    if (this != &rhs) {
42        CbcBranchingObject::operator=(rhs);
43    }
44    return *this;
45}
46CbcBranchingObject *
47CbcDummyBranchingObject::clone() const
48{
49    return (new CbcDummyBranchingObject(*this));
50}
51
52
53// Destructor
54CbcDummyBranchingObject::~CbcDummyBranchingObject ()
55{
56}
57
58/*
59  Perform a dummy branch
60*/
61double
62CbcDummyBranchingObject::branch()
63{
64    decrementNumberBranchesLeft();
65    return 0.0;
66}
67// Print what would happen
68void
69CbcDummyBranchingObject::print()
70{
71    printf("Dummy branch\n");
72}
73/** Compare the original object of \c this with the original object of \c
74    brObj. Assumes that there is an ordering of the original objects.
75    This method should be invoked only if \c this and brObj are of the same
76    type.
77    Return negative/0/positive depending on whether \c this is
78    smaller/same/larger than the argument.
79*/
80int
81CbcDummyBranchingObject::compareOriginalObject
82(const CbcBranchingObject* /*brObj*/) const
83{
84    throw("must implement");
85}
86
87/** Compare the \c this with \c brObj. \c this and \c brObj must be os the
88    same type and must have the same original object, but they may have
89    different feasible regions.
90    Return the appropriate CbcRangeCompare value (first argument being the
91    sub/superset if that's the case). In case of overlap (and if \c
92    replaceIfOverlap is true) replace the current branching object with one
93    whose feasible region is the overlap.
94*/
95CbcRangeCompare
96CbcDummyBranchingObject::compareBranchingObject
97(const CbcBranchingObject* /*brObj*/, const bool /*replaceIfOverlap*/)
98{
99    throw("must implement");
100}
101
Note: See TracBrowser for help on using the repository browser.