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 /**@file spxdantzigpr.h 26 * @brief Dantzig pricer. 27 */ 28 #ifndef _SPXDEFAULTPR_H_ 29 #define _SPXDEFAULTPR_H_ 30 31 #include <assert.h> 32 33 #include "soplex/spxpricer.h" 34 35 namespace soplex 36 { 37 38 /**@brief Dantzig pricer. 39 @ingroup Algo 40 41 Class SPxDantzigPR is an implementation class of an SPxPricer implementing 42 Dantzig's default pricing strategy, i.e., maximal/minimal reduced cost or 43 maximally violated constraint. 44 45 See SPxPricer for a class documentation. 46 */ 47 template <class R> 48 class SPxDantzigPR : public SPxPricer<R> 49 { 50 private: 51 int selectLeaveSparse();/**< sparse pricing method for leaving Simplex */ 52 53 SPxId 54 selectEnterX(); /**< choose the best entering index among columns and rows but prefer sparsity */ 55 SPxId selectEnterSparseDim(R& best, 56 SPxId& id); /**< sparse pricing method for entering Simplex (slack variables)*/ 57 SPxId selectEnterSparseCoDim(R& best, 58 SPxId& id); /**< sparse pricing method for entering Simplex */ 59 SPxId selectEnterDenseDim(R& best, 60 SPxId& id); /**< selectEnter() in dense case (slack variables) */ 61 SPxId selectEnterDenseCoDim(R& best, 62 SPxId& id); /**< selectEnter() in dense case */ 63 public: 64 65 //------------------------------------- 66 /**@name Constructors / destructors */ 67 ///@{ 68 /// default constructor 69 SPxDantzigPR() 70 : SPxPricer<R>("Dantzig") 71 {} 72 /// copy constructor 73 SPxDantzigPR(const SPxDantzigPR& old) 74 : SPxPricer<R>(old) 75 {} 76 /// assignment operator 77 SPxDantzigPR& operator=(const SPxDantzigPR& rhs) 78 { 79 if(this != &rhs) 80 { 81 SPxPricer<R>::operator=(rhs); 82 } 83 84 return *this; 85 } 86 /// destructor 87 virtual ~SPxDantzigPR() 88 {} 89 /// clone function for polymorphism 90 inline virtual SPxPricer<R>* clone() const 91 { 92 return new SPxDantzigPR(*this); 93 } 94 ///@} 95 96 97 //------------------------------------- 98 /**@name Select enter/leave */ 99 ///@{ 100 /// 101 virtual int selectLeave(); 102 /// 103 virtual SPxId selectEnter(); 104 ///@} 105 }; 106 } // namespace soplex 107 108 // For general tempalted functions 109 #include "spxdantzigpr.hpp" 110 111 #endif // _SPXDEFAULTPRR_H_ 112