source: trunk/Cbc/examples/CbcSolver3.hpp

Last change on this file was 1574, checked in by lou, 7 years ago

Change to EPL license notice.

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