source: trunk/Cbc/src/CbcSimpleIntegerPseudoCost.hpp

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

script to format sources

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1// $Id: CbcSimpleIntegerPseudoCost.hpp 2465 2019-01-03 19:26:52Z forrest $
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#ifndef CbcSimpleIntegerPseudoCost_H
9#define CbcSimpleIntegerPseudoCost_H
10
11#include "CbcSimpleInteger.hpp"
12/// Define a single integer class but with pseudo costs
13
14class CbcSimpleIntegerPseudoCost : public CbcSimpleInteger {
15
16public:
17  // Default Constructor
18  CbcSimpleIntegerPseudoCost();
19
20  // Useful constructor - passed model index
21  CbcSimpleIntegerPseudoCost(CbcModel *model, int iColumn, double breakEven = 0.5);
22
23  // Useful constructor - passed and model index and pseudo costs
24  CbcSimpleIntegerPseudoCost(CbcModel *model, int iColumn,
25    double downPseudoCost, double upPseudoCost);
26  // Useful constructor - passed and model index and pseudo costs
27  CbcSimpleIntegerPseudoCost(CbcModel *model, int dummy, int iColumn,
28    double downPseudoCost, double upPseudoCost);
29
30  // Copy constructor
31  CbcSimpleIntegerPseudoCost(const CbcSimpleIntegerPseudoCost &);
32
33  /// Clone
34  virtual CbcObject *clone() const;
35
36  // Assignment operator
37  CbcSimpleIntegerPseudoCost &operator=(const CbcSimpleIntegerPseudoCost &rhs);
38
39  // Destructor
40  virtual ~CbcSimpleIntegerPseudoCost();
41
42  /// Infeasibility - large is 0.5
43  virtual double infeasibility(const OsiBranchingInformation *info,
44    int &preferredWay) const;
45
46  /// Creates a branching object
47  virtual CbcBranchingObject *createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way);
48
49  /// Down pseudo cost
50  inline double downPseudoCost() const
51  {
52    return downPseudoCost_;
53  }
54  /// Set down pseudo cost
55  inline void setDownPseudoCost(double value)
56  {
57    downPseudoCost_ = value;
58  }
59
60  /// Up pseudo cost
61  inline double upPseudoCost() const
62  {
63    return upPseudoCost_;
64  }
65  /// Set up pseudo cost
66  inline void setUpPseudoCost(double value)
67  {
68    upPseudoCost_ = value;
69  }
70
71  /// Up down separator
72  inline double upDownSeparator() const
73  {
74    return upDownSeparator_;
75  }
76  /// Set up down separator
77  inline void setUpDownSeparator(double value)
78  {
79    upDownSeparator_ = value;
80  }
81
82  /// Return "up" estimate
83  virtual double upEstimate() const;
84  /// Return "down" estimate (default 1.0e-5)
85  virtual double downEstimate() const;
86
87  /// method - see below for details
88  inline int method() const
89  {
90    return method_;
91  }
92  /// Set method
93  inline void setMethod(int value)
94  {
95    method_ = value;
96  }
97
98protected:
99  /// data
100
101  /// Down pseudo cost
102  double downPseudoCost_;
103  /// Up pseudo cost
104  double upPseudoCost_;
105  /** Up/down separator
106        If >0.0 then do first branch up if value-floor(value)
107        >= this value
108    */
109  double upDownSeparator_;
110  /** Method -
111        0 - normal - return min (up,down)
112        1 - if before any solution return CoinMax(up,down)
113        2 - if before branched solution return CoinMax(up,down)
114        3 - always return CoinMax(up,down)
115    */
116  int method_;
117};
118
119#endif
120
121/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
122*/
Note: See TracBrowser for help on using the repository browser.