source: branches/sandbox/Cbc/src/CbcBranchCut.cpp @ 1305

Last change on this file since 1305 was 1305, checked in by EdwinStraver, 10 years ago

Moved the objects CbcCutBranchingObject?, CbcBranchToFixLots?, and CbcBranchAllDifferent? to new files, out of CbcBranchCut?.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/* $Id: CbcBranchCut.cpp 1305 2009-11-13 22:50:47Z EdwinStraver $ */
2// Copyright (C) 2004, International Business Machines
3// Corporation and others.  All Rights Reserved.
4#if defined(_MSC_VER)
5// Turn off compiler warning about long names
6#  pragma warning(disable:4786)
7#endif
8#include <cassert>
9#include <cstdlib>
10#include <cmath>
11#include <cfloat>
12//#define CBC_DEBUG
13
14#include "OsiSolverInterface.hpp"
15#include "CbcModel.hpp"
16#include "CbcMessage.hpp"
17#include "CbcBranchCut.hpp"
18#include "CoinSort.hpp"
19#include "CoinError.hpp"
20
21
22/** Default Constructor
23
24*/
25CbcBranchCut::CbcBranchCut ()
26        : CbcObject()
27{
28}
29
30/* Constructor so model can be passed up
31*/
32CbcBranchCut::CbcBranchCut (CbcModel * model)
33        : CbcObject(model)
34{
35}
36// Copy constructor
37CbcBranchCut::CbcBranchCut ( const CbcBranchCut & rhs)
38        : CbcObject(rhs)
39
40{
41}
42
43// Clone
44CbcObject *
45CbcBranchCut::clone() const
46{
47    return new CbcBranchCut(*this);
48}
49
50// Assignment operator
51CbcBranchCut &
52CbcBranchCut::operator=( const CbcBranchCut& /*rhs*/)
53{
54    return *this;
55}
56
57// Destructor
58CbcBranchCut::~CbcBranchCut ()
59{
60}
61double
62CbcBranchCut::infeasibility(const OsiBranchingInformation * /*info*/,
63                            int &preferredWay) const
64{
65    throw CoinError("Use of base class", "infeasibility", "CbcBranchCut");
66    preferredWay = -1;
67    return 0.0;
68}
69
70// This looks at solution and sets bounds to contain solution
71/** More precisely: it first forces the variable within the existing
72    bounds, and then tightens the bounds to fix the variable at the
73    nearest integer value.
74*/
75void
76CbcBranchCut::feasibleRegion()
77{
78}
79/* Return true if branch created by object should fix variables
80 */
81bool
82CbcBranchCut::boundBranch() const
83{
84    return false;
85}
86CbcBranchingObject *
87CbcBranchCut::createCbcBranch(OsiSolverInterface * /*solver*/, const OsiBranchingInformation * /*info*/, int /*way*/)
88{
89    throw CoinError("Use of base class", "createCbcBranch", "CbcBranchCut");
90    return new CbcCutBranchingObject();
91}
92
93
94/* Given valid solution (i.e. satisfied) and reduced costs etc
95   returns a branching object which would give a new feasible
96   point in direction reduced cost says would be cheaper.
97   If no feasible point returns null
98*/
99CbcBranchingObject *
100CbcBranchCut::preferredNewFeasible() const
101{
102    throw CoinError("Use of base class", "preferredNewFeasible", "CbcBranchCut");
103    return new CbcCutBranchingObject();
104}
105
106/* Given valid solution (i.e. satisfied) and reduced costs etc
107   returns a branching object which would give a new feasible
108   point in direction opposite to one reduced cost says would be cheaper.
109   If no feasible point returns null
110*/
111CbcBranchingObject *
112CbcBranchCut::notPreferredNewFeasible() const
113{
114    throw CoinError("Use of base class", "notPreferredNewFeasible", "CbcBranchCut");
115    return new CbcCutBranchingObject();
116}
117
118/*
119  Bounds may be tightened, so it may be good to be able to refresh the local
120  copy of the original bounds.
121 */
122void
123CbcBranchCut::resetBounds()
124{
125}
126
Note: See TracBrowser for help on using the repository browser.