SoPlex Documentation
Loading...
Searching...
No Matches
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-2023 Zuse Institute Berlin (ZIB) */
7/* */
8/* Licensed under the Apache License, Version 2.0 (the "License"); */
9/* you may not use this file except in compliance with the License. */
10/* You may obtain a copy of the License at */
11/* */
12/* http://www.apache.org/licenses/LICENSE-2.0 */
13/* */
14/* Unless required by applicable law or agreed to in writing, software */
15/* distributed under the License is distributed on an "AS IS" BASIS, */
16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17/* See the License for the specific language governing permissions and */
18/* limitations under the License. */
19/* */
20/* You should have received a copy of the Apache-2.0 license */
21/* along with SoPlex; see the file LICENSE. If not email to soplex@zib.de. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25
26/**@file spxstarter.h
27 * @brief SoPlex start basis generation base class.
28 */
29#ifndef _SPXDSTARTER_H_
30#define _SPXDSTARTER_H_
31
32#include <assert.h>
33
34#include "soplex/spxdefines.h"
35#include "soplex/spxsolver.h"
36
37namespace soplex
38{
39
40/**@brief SoPlex start basis generation base class.
41 @ingroup Algo
42
43 SPxStarter is the virtual base class for classes generating a starter basis
44 for the Simplex solver SoPlex. When a SPxStarter object has been loaded
45 to a SoPlex solver, the latter will call method #generate() in order to
46 have a start basis generated. Implementations of method #generate() must
47 terminate by \ref soplex::SPxSolver::load() "loading" the generated basis to
48 SoPlex. Loaded bases must be nonsingular.
49*/
50template <class R>
52{
53protected:
54
55 //-------------------------------------
56 /**@name Data */
57 ///@{
58 /// name of the starter
59 const char* m_name;
60 ///@}
61
62public:
63
64 //-------------------------------------
65 /**@name Data */
66 ///@{
67 /// constructor
68 explicit SPxStarter(const char* name)
69 : m_name(name)
70 {}
71 /// copy constructor
75 /// assignment operator
77 {
78 if(this != &rhs)
79 {
80 m_name = rhs.m_name;
81 }
82
83 return *this;
84 }
85 /// destructor.
86 virtual ~SPxStarter()
87 {
88 m_name = 0;
89 }
90 /// clone function for polymorphism
91 virtual SPxStarter* clone()const = 0;
92 ///@}
93
94 //-------------------------------------
95 /**@name Access */
96 ///@{
97 /// get name of starter.
98 virtual const char* getName() const
99 {
100 return m_name;
101 }
102 ///@}
103
104 //-------------------------------------
105 /**@name Starting */
106 ///@{
107 /// generates start basis for loaded basis.
108 virtual void generate(SPxSolverBase<R>& base) = 0;
109 ///@}
110
111 //-------------------------------------
112 /**@name Misc */
113 ///@{
114 /// checks consistency.
115 virtual bool isConsistent() const;
116 ///@}
117
118private:
119
120 //------------------------------------
121 /**@name Blocked */
122 ///@{
123 /// we have no default constructor.
125 ///@}
126
127};
128} // namespace soplex
129
130// For general templated functions
131#include "spxstarter.hpp"
132
133#endif // _SPXDSTARTER_H_
Safe arrays of data objects.
Definition dataarray.h:75
SoPlex start basis generation base class.
Definition spxstarter.h:52
SPxStarter(const char *name)
constructor
Definition spxstarter.h:68
virtual ~SPxStarter()
destructor.
Definition spxstarter.h:86
virtual const char * getName() const
get name of starter.
Definition spxstarter.h:98
virtual void generate(SPxSolverBase< R > &base)=0
generates start basis for loaded basis.
virtual bool isConsistent() const
checks consistency.
SPxStarter(const SPxStarter &old)
copy constructor
Definition spxstarter.h:72
SPxStarter & operator=(const SPxStarter &rhs)
assignment operator
Definition spxstarter.h:76
const char * m_name
name of the starter
Definition spxstarter.h:59
SPxStarter()
we have no default constructor.
virtual SPxStarter * clone() const =0
clone function for polymorphism
Everything should be within this namespace.
Debugging, floating point type and parameter definitions.
main LP solver class