source: trunk/Cbc/examples/CbcSolver2.hpp @ 310

Last change on this file since 310 was 83, checked in by forrest, 15 years ago

samples

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1// Copyright (C) 2005, International Business Machines
2// Corporation and others.  All Rights Reserved.
3
4#ifndef CbcSolver2_H
5#define CbcSolver2_H
6
7#include "OsiClpSolverInterface.hpp"
8class CbcModel;
9//#############################################################################
10
11/**
12
13    This is to allow the user to replace initialSolve and resolve.
14    This version is to try and speed up long thin problems.
15
16    This particular version assumes unit elements and rhs
17    Can be E or G rhs
18*/
19
20class CbcSolver2 : public OsiClpSolverInterface {
21
22public:
23  //---------------------------------------------------------------------------
24  /**@name Solve methods */
25  //@{
26    /// Solve initial LP relaxation
27    virtual void initialSolve();
28
29    /// Resolve an LP relaxation after problem modification
30    virtual void resolve();
31
32  //@}
33
34
35  /**@name Constructors and destructors */
36  //@{
37    /// Default Constructor
38    CbcSolver2 ();
39   
40    /// Clone
41    virtual OsiSolverInterface * clone(bool CopyData=true) const;
42   
43    /// Copy constructor
44    CbcSolver2 (const CbcSolver2 &);
45   
46    /// Assignment operator
47    CbcSolver2 & operator=(const CbcSolver2& rhs);
48   
49    /// Destructor
50    virtual ~CbcSolver2 ();
51
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  { return node_;};
62  /// Get memory (i.e. how recent use should be)
63  inline int getMemory() const
64  { return memory_;};
65  /// Get current count
66  inline int getCount() const
67  { return count_;};
68  /// Set memory (i.e. how recent use should be)
69  inline void setMemory(int value)
70  { memory_=value;};
71  /// Say whether to just count usage
72  inline void setAlgorithm(int value)
73  { algorithm_=value;};
74  /// Say whether to just count usage
75  inline int getAlgorithm() const
76  { return algorithm_;};
77  /// Strategy
78  inline void setStrategy(int value)
79  { strategy_=value;};
80  /// Strategy
81  inline int getStrategy() const
82  { return strategy_;};
83  //@}
84
85  //---------------------------------------------------------------------------
86
87private:
88 
89  /**@name Private member data */
90  //@{
91  /// Node number when variable last in problem
92  int * node_;
93  /// How many times in problem
94  int * howMany_;
95  /// Pointer back to model
96  CbcModel * model_;
97  /// Counter
98  int count_;
99  /// How recently it must have been used
100  int memory_;
101  /// If 0 nothing, 1 compress and fix, 2 long thin
102  int algorithm_;
103  /// If 0 get rid of rows, 1 keep rows (to stay dual feasible)
104  int strategy_;
105  //@}
106};
107
108#endif
Note: See TracBrowser for help on using the repository browser.