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 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 37 namespace 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 */ 46 template <class R> 47 class SPxSumST : public SPxVectorST<R> 48 { 49 protected: 50 51 //------------------------------------- 52 /**@name Protected helpers */ 53 ///@{ 54 /// sets up variable weights. 55 void setupWeights(SPxSolverBase<R>& base); 56 ///@} 57 58 public: 59 60 //------------------------------------- 61 /**@name Construction / destruction */ 62 ///@{ 63 /// default constructor. 64 SPxSumST() 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 75 SPxSumST& operator=(const SPxSumST& rhs) 76 { 77 if(this != &rhs) 78 { 79 SPxVectorST<R>::operator=(rhs); 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_ 102