source: trunk/Cbc/examples/CbcSolver2.hpp

Last change on this file was 1574, checked in by lou, 8 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.7 KB
Line 
1// $Id: CbcSolver2.hpp 1574 2011-01-05 01:13:55Z unxusr $
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
37  /**@name Constructors and destructors */
38  //@{
39    /// Default Constructor
40    CbcSolver2 ();
41   
42    /// Clone
43    virtual OsiSolverInterface * clone(bool CopyData=true) const;
44   
45    /// Copy constructor
46    CbcSolver2 (const CbcSolver2 &);
47   
48    /// Assignment operator
49    CbcSolver2 & operator=(const CbcSolver2& rhs);
50   
51    /// Destructor
52    virtual ~CbcSolver2 ();
53
54  //@}
55
56
57  /**@name Sets and Getss */
58  //@{
59  /// Setup arrays - ones in keep will always be in
60  void initialize(CbcModel * model, const char * keep);
61  /// get which ones have been used
62  inline const int * when() const
63  { return node_;}
64  /// Get memory (i.e. how recent use should be)
65  inline int getMemory() const
66  { return memory_;}
67  /// Get current count
68  inline int getCount() const
69  { return count_;}
70  /// Set memory (i.e. how recent use should be)
71  inline void setMemory(int value)
72  { memory_=value;}
73  /// Say whether to just count usage
74  inline void setAlgorithm(int value)
75  { algorithm_=value;}
76  /// Say whether to just count usage
77  inline int getAlgorithm() const
78  { return algorithm_;}
79  /// Strategy
80  inline void setStrategy(int value)
81  { strategy_=value;}
82  /// Strategy
83  inline int getStrategy() const
84  { return strategy_;}
85  //@}
86
87  //---------------------------------------------------------------------------
88
89private:
90 
91  /**@name Private member data */
92  //@{
93  /// Node number when variable last in problem
94  int * node_;
95  /// How many times in problem
96  int * howMany_;
97  /// Pointer back to model
98  CbcModel * model_;
99  /// Counter
100  int count_;
101  /// How recently it must have been used
102  int memory_;
103  /// If 0 nothing, 1 compress and fix, 2 long thin
104  int algorithm_;
105  /// If 0 get rid of rows, 1 keep rows (to stay dual feasible)
106  int strategy_;
107  //@}
108};
109
110#endif
Note: See TracBrowser for help on using the repository browser.