source: trunk/Cbc/examples/CbcSolver2.hpp

Last change on this file was 2469, checked in by unxusr, 4 months ago

formatting

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