Scippy

SoPlex

Sequential object-oriented simPlex

spxsumst.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 spxsumst.h
18  * @brief Simple heuristic SPxStarter.
19  */
20 #ifndef _SPXSUMST_H_
21 #define _SPXSUMST_H_
22 
23 
24 #include <assert.h>
25 
26 #include "soplex/spxvectorst.h"
27 
28 namespace soplex
29 {
30 
31 /**@brief Simple heuristic SPxStarter.
32  @ingroup Algo
33 
34  Testing version of an SPxVectorST using a very simplistic heuristic to
35  build up an approximated solution vector.
36 */
37 template <class R>
38 class SPxSumST : public SPxVectorST<R>
39 {
40 protected:
41 
42  //-------------------------------------
43  /**@name Protected helpers */
44  ///@{
45  /// sets up variable weights.
46  void setupWeights(SPxSolverBase<R>& base);
47  ///@}
48 
49 public:
50 
51  //-------------------------------------
52  /**@name Construction / destruction */
53  ///@{
54  /// default constructor.
56  {
57  this->m_name = "Sum";
58  }
59  /// copy constructor
60  SPxSumST(const SPxSumST& old)
61  : SPxVectorST<R>(old)
62  {
63  assert(this->isConsistent());
64  }
65  /// assignment operator
67  {
68  if(this != &rhs)
69  {
71 
72  assert(this->isConsistent());
73  }
74 
75  return *this;
76  }
77  /// destructor.
78  virtual ~SPxSumST()
79  {}
80  /// clone function for polymorphism
81  inline virtual SPxStarter<R>* clone() const
82  {
83  return new SPxSumST(*this);
84  }
85  ///@}
86 
87 };
88 
89 } // namespace soplex
90 
91 #include "spxsumst.hpp"
92 #endif // _SPXSUMST_H_
void setupWeights(SPxSolverBase< R > &base)
sets up variable weights.
virtual SPxStarter< R > * clone() const
clone function for polymorphism
Definition: spxsumst.h:81
SPxSumST & operator=(const SPxSumST &rhs)
assignment operator
Definition: spxsumst.h:66
Solution vector based start basis.
Sequential object-oriented SimPlex.SPxSolverBase is an LP solver class using the revised Simplex algo...
Definition: spxbasis.h:49
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
virtual ~SPxSumST()
destructor.
Definition: spxsumst.h:78
Solution vector based start basis.This version of SPxWeightST can be used to construct a starting bas...
Definition: spxvectorst.h:45
Everything should be within this namespace.
SPxSumST()
default constructor.
Definition: spxsumst.h:55
SPxSumST(const SPxSumST &old)
copy constructor
Definition: spxsumst.h:60
Simple heuristic SPxStarter.Testing version of an SPxVectorST using a very simplistic heuristic to bu...
Definition: spxsumst.h:38
SPxVectorST & operator=(const SPxVectorST &rhs)
assignment operator
Definition: spxvectorst.h:92
virtual bool isConsistent() const
consistency check.