class_pricingtype.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program */
4 /* GCG --- Generic Column Generation */
5 /* a Dantzig-Wolfe decomposition based extension */
6 /* of the branch-cut-and-price framework */
7 /* SCIP --- Solving Constraint Integer Programs */
8 /* */
9 /* Copyright (C) 2010-2018 Operations Research, RWTH Aachen University */
10 /* Zuse Institute Berlin (ZIB) */
11 /* */
12 /* This program is free software; you can redistribute it and/or */
13 /* modify it under the terms of the GNU Lesser General Public License */
14 /* as published by the Free Software Foundation; either version 3 */
15 /* of the License, or (at your option) any later version. */
16 /* */
17 /* This program is distributed in the hope that it will be useful, */
18 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
19 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
20 /* GNU Lesser General Public License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with this program; if not, write to the Free Software */
24 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.*/
25 /* */
26 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
27 
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35 #ifndef GCG_CLASS_PRICINGTYPE_H__
36 #define GCG_CLASS_PRICINGTYPE_H__
37 
38 #include "objscip/objscip.h"
39 #include "pricer_gcg.h"
40 
42 {
43 protected:
44  SCIP* scip_;
46  SCIP_CLOCK* clock;
47 
48  int calls;
49  int maxrounds;
55  SCIP_Real relmaxprobsroot;
56  SCIP_Real relmaxprobs;
59 public:
61  PricingType();
62 
64  SCIP* p_scip
65  );
66 
68  virtual ~PricingType();
69 
71  virtual SCIP_Real consGetDual(
72  SCIP* scip,
73  SCIP_CONS* cons
74  ) const = 0;
75 
77  virtual SCIP_Real rowGetDual(
78  SCIP_ROW* row
79  ) const = 0;
80 
82  virtual SCIP_Real varGetObj(
83  SCIP_VAR* var
84  ) const = 0;
85 
87  virtual SCIP_RETCODE addParameters() = 0;
88 
90  virtual SCIP_RETCODE startClock();
91 
93  virtual SCIP_RETCODE stopClock();
94 
96  virtual SCIP_Real getClockTime() const;
97 
99  virtual int getMaxrounds() const
100  {
101  return maxrounds;
102  }
103 
105  virtual int getMaxcolsround() const = 0;
106 
108  virtual int getMaxcolsprob() const = 0;
109 
112  {
113  return maxsuccessfulprobs;
114  }
115 
117  virtual SCIP_Real getRelmaxprobs() const = 0;
118 
120  SCIP_Real getRelmaxsuccessfulprobs() const
121  {
122  return relmaxsuccessfulprobs;
123  }
124 
127  {
128  return type;
129  }
130 
132  int getCalls() const
133  {
134  return calls;
135  }
136 
138  virtual void incCalls()
139  {
140  calls++;
141  }
142 
144  SCIP_RETCODE resetCalls()
145  {
146  calls = 0;
147  SCIP_CALL( SCIPresetClock(scip_, clock) );
148  return SCIP_OKAY;
149  }
150 
151 };
152 
154 {
155 public:
158 
160  SCIP* p_scip
161  );
162 
164  virtual ~ReducedCostPricing() {}
165 
166  virtual SCIP_RETCODE addParameters();
167 
168  virtual SCIP_Real consGetDual(
169  SCIP* scip,
170  SCIP_CONS* cons
171  ) const;
172 
173  virtual SCIP_Real rowGetDual(
174  SCIP_ROW* row
175  ) const;
176 
177  virtual SCIP_Real varGetObj(
178  SCIP_VAR* var
179  ) const ;
180 
182  virtual int getMaxcolsround() const;
183 
185  virtual int getMaxcolsprob() const;
186 
188  virtual SCIP_Real getRelmaxprobs() const;
189 };
190 
192 {
193 public:
195  FarkasPricing();
196 
198  SCIP* p_scip
199  );
200 
202  virtual ~FarkasPricing() {}
203 
204  virtual SCIP_RETCODE addParameters();
205 
206  virtual SCIP_Real consGetDual(
207  SCIP* scip,
208  SCIP_CONS* cons
209  ) const;
210 
211  virtual SCIP_Real rowGetDual(
212  SCIP_ROW* row
213  ) const;
214 
215  virtual SCIP_Real varGetObj(
216  SCIP_VAR* var
217  ) const;
218 
220  virtual int getMaxcolsround() const;
221 
223  virtual int getMaxcolsprob() const;
224 
226  virtual SCIP_Real getRelmaxprobs() const;
227 };
228 
229 #endif /* CLASS_PRICINGTYPE_H_ */
enum GCG_Pricetype GCG_PRICETYPE
Definition: pricer_gcg.h:55
GCG_PRICETYPE type
virtual ~PricingType()
SCIP_Real relmaxsuccessfulprobs
virtual SCIP_RETCODE stopClock()
virtual int getMaxrounds() const
int getMaxsuccessfulprobs() const
virtual SCIP_RETCODE startClock()
virtual SCIP_Real rowGetDual(SCIP_ROW *row) const =0
SCIP_RETCODE resetCalls()
virtual int getMaxcolsround() const =0
virtual void incCalls()
int getCalls() const
GCG variable pricer.
virtual SCIP_Real getRelmaxprobs() const =0
GCG_PRICETYPE getType() const
virtual SCIP_Real varGetObj(SCIP_VAR *var) const =0
SCIP_CLOCK * clock
virtual SCIP_RETCODE addParameters()=0
virtual int getMaxcolsprob() const =0
virtual SCIP_Real getClockTime() const
SCIP_Real relmaxprobs
virtual ~FarkasPricing()
SCIP_Real getRelmaxsuccessfulprobs() const
virtual SCIP_Real consGetDual(SCIP *scip, SCIP_CONS *cons) const =0
SCIP_Real relmaxprobsroot