source: trunk/Cbc/examples/CbcSolver3.hpp @ 2496

Last change on this file since 2496 was 2469, checked in by unxusr, 8 months ago

formatting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1// $Id: CbcSolver3.hpp 2469 2019-01-06 23:17:46Z forrest $
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 CbcSolver3_H
7#define CbcSolver3_H
8
9#include "OsiClpSolverInterface.hpp"
10class CbcModel;
11//#############################################################################
12
13/**
14
15    This is to allow the user to replace initialSolve and resolve
16*/
17
18class CbcSolver3 : public OsiClpSolverInterface {
19
20public:
21  //---------------------------------------------------------------------------
22  /**@name Solve methods */
23  //@{
24  /// Solve initial LP relaxation
25  virtual void initialSolve();
26
27  /// Resolve an LP relaxation after problem modification
28  virtual void resolve();
29
30  //@}
31
32  /**@name Constructors and destructors */
33  //@{
34  /// Default Constructor
35  CbcSolver3();
36
37  /// Clone
38  virtual OsiSolverInterface *clone(bool CopyData = true) const;
39
40  /// Copy constructor
41  CbcSolver3(const CbcSolver3 &);
42
43  /// Assignment operator
44  CbcSolver3 &operator=(const CbcSolver3 &rhs);
45
46  /// Destructor
47  virtual ~CbcSolver3();
48
49  //@}
50
51  /**@name Sets and Getss */
52  //@{
53  /// Setup arrays - ones in keep will always be in
54  void initialize(CbcModel *model, const char *keep);
55  /// get which ones have been used
56  inline const int *when() const
57  {
58    return node_;
59  }
60  /// Get memory (i.e. how recent use should be)
61  inline int getMemory() const
62  {
63    return memory_;
64  }
65  /// Get current count
66  inline int getCount() const
67  {
68    return count_;
69  }
70  /// Set memory (i.e. how recent use should be)
71  inline void setMemory(int value)
72  {
73    memory_ = value;
74  }
75  /// Say whether to believe infeasible
76  inline void setBelieveInfeasible(bool yesNo)
77  {
78    believeInfeasible_ = yesNo;
79  }
80  /// Say whether to just count usage
81  inline void setAlgorithm(int value)
82  {
83    algorithm_ = value;
84  }
85  /// Do nested search if this fraction fixed
86  inline void setNested(double value)
87  {
88    nestedSearch_ = value;
89  }
90  /// Say whether to just count usage
91  inline int getAlgorithm() const
92  {
93    return algorithm_;
94  }
95  /// Do nested search if this fraction fixed
96  inline double getNested() const
97  {
98    return nestedSearch_;
99  }
100  //@}
101
102  //---------------------------------------------------------------------------
103
104private:
105  /**@name Private member data */
106  //@{
107  /// Do nested search if this fraction fixed
108  double nestedSearch_;
109  /// Node number when variable last in problem
110  int *node_;
111  /// How many times in problem
112  int *howMany_;
113  /// Pointer back to model
114  CbcModel *model_;
115  /// Counter
116  int count_;
117  /// How recently it must have been used
118  int memory_;
119  /// If infeasible on subset means infeasible
120  bool believeInfeasible_;
121  /// If 0 nothing, 1 compress and fix, 2 long thin
122  bool algorithm_;
123  //@}
124};
125
126#endif
Note: See TracBrowser for help on using the repository browser.