Scippy

SoPlex

Sequential object-oriented simPlex

spxstarter.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the class library */
4 /* SoPlex --- the Sequential object-oriented simPlex. */
5 /* */
6 /* Copyright (C) 1996-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SoPlex is distributed under the terms of the ZIB Academic Licence. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SoPlex; see the file COPYING. If not email to soplex@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 
17 /**@file spxstarter.h
18  * @brief SoPlex start basis generation base class.
19  */
20 #ifndef _SPXDSTARTER_H_
21 #define _SPXDSTARTER_H_
22 
23 #include <assert.h>
24 
25 #include "soplex/spxdefines.h"
26 #include "soplex/spxsolver.h"
27 
28 namespace soplex
29 {
30 
31 /**@brief SoPlex start basis generation base class.
32  @ingroup Algo
33 
34  SPxStarter is the virtual base class for classes generating a starter basis
35  for the Simplex solver SoPlex. When a SPxStarter object has been loaded
36  to a SoPlex solver, the latter will call method #generate() in order to
37  have a start basis generated. Implementations of method #generate() must
38  terminate by \ref soplex::SPxSolver::load() "loading" the generated basis to
39  SoPlex. Loaded bases must be nonsingular.
40 */
41 template <class R>
42 class SPxStarter
43 {
44 protected:
45 
46  //-------------------------------------
47  /**@name Data */
48  ///@{
49  /// name of the starter
50  const char* m_name;
51  ///@}
52 
53 public:
54 
55  //-------------------------------------
56  /**@name Data */
57  ///@{
58  /// constructor
59  explicit SPxStarter(const char* name)
60  : m_name(name)
61  {}
62  /// copy constructor
63  SPxStarter(const SPxStarter& old)
64  : m_name(old.m_name)
65  {}
66  /// assignment operator
68  {
69  if(this != &rhs)
70  {
71  m_name = rhs.m_name;
72  }
73 
74  return *this;
75  }
76  /// destructor.
77  virtual ~SPxStarter()
78  {
79  m_name = 0;
80  }
81  /// clone function for polymorphism
82  virtual SPxStarter* clone()const = 0;
83  ///@}
84 
85  //-------------------------------------
86  /**@name Access */
87  ///@{
88  /// get name of starter.
89  virtual const char* getName() const
90  {
91  return m_name;
92  }
93  ///@}
94 
95  //-------------------------------------
96  /**@name Starting */
97  ///@{
98  /// generates start basis for loaded basis.
99  virtual void generate(SPxSolverBase<R>& base) = 0;
100  ///@}
101 
102  //-------------------------------------
103  /**@name Misc */
104  ///@{
105  /// checks consistency.
106  virtual bool isConsistent() const;
107  ///@}
108 
109 private:
110 
111  //------------------------------------
112  /**@name Blocked */
113  ///@{
114  /// we have no default constructor.
115  SPxStarter();
116  ///@}
117 
118 };
119 } // namespace soplex
120 
121 // For general templated functions
122 #include "spxstarter.hpp"
123 
124 #endif // _SPXDSTARTER_H_
SPxStarter()
we have no default constructor.
Sequential object-oriented SimPlex.SPxSolverBase is an LP solver class using the revised Simplex algo...
Definition: spxbasis.h:49
virtual SPxStarter * clone() const =0
clone function for polymorphism
SoPlex start basis generation base class.SPxStarter is the virtual base class for classes generating ...
Definition: spxsolver.h:59
const char * m_name
name of the starter
Definition: spxstarter.h:50
SPxStarter & operator=(const SPxStarter &rhs)
assignment operator
Definition: spxstarter.h:67
virtual void generate(SPxSolverBase< R > &base)=0
generates start basis for loaded basis.
main LP solver class
virtual ~SPxStarter()
destructor.
Definition: spxstarter.h:77
Debugging, floating point type and parameter definitions.
Everything should be within this namespace.
SPxStarter(const SPxStarter &old)
copy constructor
Definition: spxstarter.h:63
virtual bool isConsistent() const
checks consistency.
virtual const char * getName() const
get name of starter.
Definition: spxstarter.h:89
SPxStarter(const char *name)
constructor
Definition: spxstarter.h:59