source: trunk/Cbc/src/CbcFathom.hpp @ 2464

Last change on this file since 2464 was 2464, checked in by unxusr, 7 months ago

.clang-format with proposal for formatting code

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1/* $Id: CbcFathom.hpp 2464 2019-01-03 19:03:23Z unxusr $ */
2// Copyright (C) 2004, 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#ifndef CbcFathom_H
7#define CbcFathom_H
8#include "CbcConfig.h"
9
10/*
11  This file contains two classes, CbcFathom and CbcOsiSolver. It's unclear why
12  they're in the same file. CbcOsiSolver is a base class for CbcLinked.
13
14  --lh, 071031 --
15*/
16
17class CbcModel;
18
19//#############################################################################
20/** Fathom base class.
21
22    The idea is that after some branching the problem will be effectively smaller than
23    the original problem and maybe there will be a more specialized technique which can completely
24    fathom this branch quickly.
25
26    One method is to presolve the problem to give a much smaller new problem and then do branch
27    and cut on that.  Another might be dynamic programming.
28
29 */
30
31class CbcFathom {
32public:
33  // Default Constructor
34  CbcFathom();
35
36  // Constructor with model - assumed before cuts
37  CbcFathom(CbcModel &model);
38
39  virtual ~CbcFathom();
40
41  /// update model (This is needed if cliques update matrix etc)
42  virtual void setModel(CbcModel *model);
43
44  /// Clone
45  virtual CbcFathom *clone() const = 0;
46
47  /// Resets stuff if model changes
48  virtual void resetModel(CbcModel *model) = 0;
49
50  /** returns 0 if no fathoming attempted, 1 fully fathomed,
51        2 incomplete search, 3 incomplete search but treat as complete.
52        If solution then newSolution will not be NULL and
53        will be freed by CbcModel.  It is expected that the solution is better
54        than best so far but CbcModel will double check.
55
56        If returns 3 then of course there is no guarantee of global optimum
57    */
58  virtual int fathom(double *&newSolution) = 0;
59
60  // Is this method possible
61  inline bool possible() const
62  {
63    return possible_;
64  }
65
66protected:
67  /// Model
68  CbcModel *model_;
69  /// Possible - if this method of fathoming can be used
70  bool possible_;
71
72private:
73  /// Illegal Assignment operator
74  CbcFathom &operator=(const CbcFathom &rhs);
75};
76
77#include "OsiClpSolverInterface.hpp"
78
79//#############################################################################
80
81/**
82
83This is for codes where solver needs to know about CbcModel
84  Seems to provide only one value-added feature, a CbcModel object.
85
86*/
87
88class CbcOsiSolver : public OsiClpSolverInterface {
89
90public:
91  /**@name Constructors and destructors */
92  //@{
93  /// Default Constructor
94  CbcOsiSolver();
95
96  /// Clone
97  virtual OsiSolverInterface *clone(bool copyData = true) const;
98
99  /// Copy constructor
100  CbcOsiSolver(const CbcOsiSolver &);
101
102  /// Assignment operator
103  CbcOsiSolver &operator=(const CbcOsiSolver &rhs);
104
105  /// Destructor
106  virtual ~CbcOsiSolver();
107
108  //@}
109
110  /**@name Sets and Gets */
111  //@{
112  /// Set Cbc Model
113  inline void setCbcModel(CbcModel *model)
114  {
115    cbcModel_ = model;
116  }
117  /// Return Cbc Model
118  inline CbcModel *cbcModel() const
119  {
120    return cbcModel_;
121  }
122  //@}
123
124  //---------------------------------------------------------------------------
125
126protected:
127  /**@name Private member data */
128  //@{
129  /// Pointer back to CbcModel
130  CbcModel *cbcModel_;
131  //@}
132};
133#endif
Note: See TracBrowser for help on using the repository browser.