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