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-2019 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 */
42 {
43 protected:
44 
45  //-------------------------------------
46  /**@name Data */
47  //@{
48  /// name of the starter
49  const char* m_name;
50  //@}
51 
52 public:
53 
54  //-------------------------------------
55  /**@name Data */
56  //@{
57  /// constructor
58  explicit SPxStarter(const char* name)
59  : m_name(name)
60  {}
61  /// copy constructor
62  SPxStarter(const SPxStarter& old)
63  : m_name(old.m_name)
64  {}
65  /// assignment operator
67  {
68  if(this != &rhs)
69  {
70  m_name = rhs.m_name;
71  }
72 
73  return *this;
74  }
75  /// destructor.
76  virtual ~SPxStarter()
77  {
78  m_name = 0;
79  }
80  /// clone function for polymorphism
81  virtual SPxStarter* clone()const = 0;
82  //@}
83 
84  //-------------------------------------
85  /**@name Access */
86  //@{
87  /// get name of starter.
88  virtual const char* getName() const
89  {
90  return m_name;
91  }
92  //@}
93 
94  //-------------------------------------
95  /**@name Starting */
96  //@{
97  /// generates start basis for loaded basis.
98  virtual void generate(SPxSolver& base) = 0;
99  //@}
100 
101  //-------------------------------------
102  /**@name Misc */
103  //@{
104  /// checks consistency.
105  virtual bool isConsistent() const;
106  //@}
107 
108 private:
109 
110  //------------------------------------
111  /**@name Blocked */
112  //@{
113  /// we have no default constructor.
114  SPxStarter();
115  //@}
116 
117 };
118 } // namespace soplex
119 #endif // _SPXDSTARTER_H_
SPxStarter()
we have no default constructor.
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: spxstarter.h:41
const char * m_name
name of the starter
Definition: spxstarter.h:49
SPxStarter & operator=(const SPxStarter &rhs)
assignment operator
Definition: spxstarter.h:66
main LP solver class
virtual bool isConsistent() const
checks consistency.
Definition: spxstarter.cpp:25
virtual void generate(SPxSolver &base)=0
generates start basis for loaded basis.
virtual ~SPxStarter()
destructor.
Definition: spxstarter.h:76
Debugging, floating point type and parameter definitions.
Sequential object-oriented SimPlex.SPxSolver is an LP solver class using the revised Simplex algorith...
Definition: spxsolver.h:85
Everything should be within this namespace.
SPxStarter(const SPxStarter &old)
copy constructor
Definition: spxstarter.h:62
virtual const char * getName() const
get name of starter.
Definition: spxstarter.h:88
SPxStarter(const char *name)
constructor
Definition: spxstarter.h:58