Scippy

SCIP

Solving Constraint Integer Programs

pricer.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2016 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file pricer.h
17  * @brief internal methods for variable pricers
18  * @author Tobias Achterberg
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_PRICER_H__
24 #define __SCIP_PRICER_H__
25 
26 
27 #include "scip/def.h"
28 #include "blockmemshell/memory.h"
29 #include "scip/type_retcode.h"
30 #include "scip/type_result.h"
31 #include "scip/type_set.h"
32 #include "scip/type_lp.h"
33 #include "scip/type_prob.h"
34 #include "scip/type_pricestore.h"
35 #include "scip/type_pricer.h"
36 #include "scip/pub_pricer.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 
43 /** copies the given pricer to a new scip */
44 extern
46  SCIP_PRICER* pricer, /**< pricer */
47  SCIP_SET* set, /**< SCIP_SET of SCIP to copy to */
48  SCIP_Bool* valid /**< was the copying process valid? */
49  );
50 
51 /** creates a variable pricer */
52 extern
54  SCIP_PRICER** pricer, /**< pointer to variable pricer data structure */
55  SCIP_SET* set, /**< global SCIP settings */
56  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
57  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
58  const char* name, /**< name of variable pricer */
59  const char* desc, /**< description of variable pricer */
60  int priority, /**< priority of the variable pricer */
61  SCIP_Bool delay, /**< should the pricer be delayed until no other pricers or already existing
62  * problem variables with negative reduced costs are found */
63  SCIP_DECL_PRICERCOPY ((*pricercopy)), /**< copy method of pricer or NULL if you don't want to copy your plugin into sub-SCIPs */
64  SCIP_DECL_PRICERFREE ((*pricerfree)), /**< destructor of variable pricer */
65  SCIP_DECL_PRICERINIT ((*pricerinit)), /**< initialize variable pricer */
66  SCIP_DECL_PRICEREXIT ((*pricerexit)), /**< deinitialize variable pricer */
67  SCIP_DECL_PRICERINITSOL((*pricerinitsol)),/**< solving process initialization method of variable pricer */
68  SCIP_DECL_PRICEREXITSOL((*pricerexitsol)),/**< solving process deinitialization method of variable pricer */
69  SCIP_DECL_PRICERREDCOST((*pricerredcost)),/**< reduced cost pricing method of variable pricer for feasible LPs */
70  SCIP_DECL_PRICERFARKAS((*pricerfarkas)), /**< Farkas pricing method of variable pricer for infeasible LPs */
71  SCIP_PRICERDATA* pricerdata /**< variable pricer data */
72  );
73 
74 /** calls destructor and frees memory of variable pricer */
75 extern
77  SCIP_PRICER** pricer, /**< pointer to variable pricer data structure */
78  SCIP_SET* set /**< global SCIP settings */
79  );
80 
81 /** initializes variable pricer */
82 extern
84  SCIP_PRICER* pricer, /**< variable pricer */
85  SCIP_SET* set /**< global SCIP settings */
86  );
87 
88 /** calls exit method of variable pricer */
89 extern
91  SCIP_PRICER* pricer, /**< variable pricer */
92  SCIP_SET* set /**< global SCIP settings */
93  );
94 
95 /** informs variable pricer that the branch and bound process is being started */
96 extern
98  SCIP_PRICER* pricer, /**< variable pricer */
99  SCIP_SET* set /**< global SCIP settings */
100  );
101 
102 /** informs variable pricer that the branch and bound process data is being freed */
103 extern
105  SCIP_PRICER* pricer, /**< variable pricer */
106  SCIP_SET* set /**< global SCIP settings */
107  );
108 
109 /** activates pricer such that it is called in LP solving loop */
110 extern
112  SCIP_PRICER* pricer, /**< variable pricer */
113  SCIP_SET* set /**< global SCIP settings */
114  );
115 
116 /** deactivates pricer such that it is no longer called in LP solving loop */
117 extern
119  SCIP_PRICER* pricer, /**< variable pricer */
120  SCIP_SET* set /**< global SCIP settings */
121  );
122 
123 /** enables or disables all clocks of \p pricer, depending on the value of the flag */
124 extern
126  SCIP_PRICER* pricer, /**< the pricer for which all clocks should be enabled or disabled */
127  SCIP_Bool enable /**< should the clocks of the pricer be enabled? */
128  );
129 
130 /** calls reduced cost pricing method of variable pricer */
131 extern
133  SCIP_PRICER* pricer, /**< variable pricer */
134  SCIP_SET* set, /**< global SCIP settings */
135  SCIP_PROB* prob, /**< transformed problem */
136  SCIP_Real* lowerbound, /**< local lower bound computed by the pricer */
137  SCIP_Bool* stopearly, /**< should pricing be stopped, although new variables were added? */
138  SCIP_RESULT* result /**< result of the pricing process */
139  );
140 
141 /** calls Farkas pricing method of variable pricer */
142 extern
144  SCIP_PRICER* pricer, /**< variable pricer */
145  SCIP_SET* set, /**< global SCIP settings */
146  SCIP_PROB* prob, /**< transformed problem */
147  SCIP_RESULT* result /**< result of the pricing process */
148  );
149 
150 /** depending on the LP's solution status, calls reduced cost or Farkas pricing method of variable pricer */
151 extern
153  SCIP_PRICER* pricer, /**< variable pricer */
154  SCIP_SET* set, /**< global SCIP settings */
155  SCIP_PROB* prob, /**< transformed problem */
156  SCIP_LP* lp, /**< LP data */
157  SCIP_PRICESTORE* pricestore, /**< pricing storage */
158  SCIP_Real* lowerbound, /**< local lower bound computed by the pricer */
159  SCIP_Bool* stopearly, /**< should pricing be stopped, although new variables were added? */
160  SCIP_RESULT* result /**< result of the pricing process */
161  );
162 
163 /** sets priority of variable pricer */
164 extern
166  SCIP_PRICER* pricer, /**< variable pricer */
167  SCIP_SET* set, /**< global SCIP settings */
168  int priority /**< new priority of the variable pricer */
169  );
170 
171 /** sets copy callback of pricer */
172 extern
173 void SCIPpricerSetCopy(
174  SCIP_PRICER* pricer, /**< variable pricer */
175  SCIP_DECL_PRICERCOPY ((*pricercopy)) /**< copy callback of pricer */
176  );
177 
178 /** sets destructor callback of pricer */
179 extern
180 void SCIPpricerSetFree(
181  SCIP_PRICER* pricer, /**< pricer */
182  SCIP_DECL_PRICERFREE ((*pricerfree)) /**< destructor of pricer */
183  );
184 
185 /** sets initialization callback of pricer */
186 extern
187 void SCIPpricerSetInit(
188  SCIP_PRICER* pricer, /**< pricer */
189  SCIP_DECL_PRICERINIT ((*pricerinit)) /**< initialize pricer */
190  );
191 
192 /** sets deinitialization callback of pricer */
193 extern
194 void SCIPpricerSetExit(
195  SCIP_PRICER* pricer, /**< pricer */
196  SCIP_DECL_PRICEREXIT ((*pricerexit)) /**< deinitialize pricer */
197  );
198 
199 /** sets solving process initialization callback of pricer */
200 extern
202  SCIP_PRICER* pricer, /**< pricer */
203  SCIP_DECL_PRICERINITSOL ((*pricerinitsol))/**< solving process initialization callback of pricer */
204  );
205 
206 /** sets solving process deinitialization callback of pricer */
207 extern
209  SCIP_PRICER* pricer, /**< pricer */
210  SCIP_DECL_PRICEREXITSOL ((*pricerexitsol))/**< solving process deinitialization callback of pricer */
211  );
212 
213 #ifdef __cplusplus
214 }
215 #endif
216 
217 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:51
void SCIPpricerSetFree(SCIP_PRICER *pricer, SCIP_DECL_PRICERFREE((*pricerfree)))
Definition: pricer.c:495
SCIP_RETCODE SCIPpricerRedcost(SCIP_PRICER *pricer, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real *lowerbound, SCIP_Bool *stopearly, SCIP_RESULT *result)
Definition: pricer.c:345
SCIP_RETCODE SCIPpricerInit(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:186
void SCIPpricerSetExit(SCIP_PRICER *pricer, SCIP_DECL_PRICEREXIT((*pricerexit)))
Definition: pricer.c:517
#define SCIP_DECL_PRICEREXIT(x)
Definition: type_pricer.h:70
void SCIPpricerEnableOrDisableClocks(SCIP_PRICER *pricer, SCIP_Bool enable)
Definition: pricer.c:634
SCIP_RETCODE SCIPpricerFree(SCIP_PRICER **pricer, SCIP_SET *set)
Definition: pricer.c:160
type definitions for storing priced variables
#define SCIP_DECL_PRICERINIT(x)
Definition: type_pricer.h:62
void SCIPpricerSetInit(SCIP_PRICER *pricer, SCIP_DECL_PRICERINIT((*pricerinit)))
Definition: pricer.c:506
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for global SCIP settings
type definitions for return codes for SCIP methods
#define SCIP_DECL_PRICEREXITSOL(x)
Definition: type_pricer.h:92
#define SCIP_DECL_PRICERCOPY(x)
Definition: type_pricer.h:46
type definitions for LP management
type definitions for variable pricers
SCIP_RETCODE SCIPpricerActivate(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:305
#define SCIP_DECL_PRICERFARKAS(x)
Definition: type_pricer.h:165
void SCIPpricerSetPriority(SCIP_PRICER *pricer, SCIP_SET *set, int priority)
Definition: pricer.c:580
SCIP_RETCODE SCIPpricerCopyInclude(SCIP_PRICER *pricer, SCIP_SET *set, SCIP_Bool *valid)
Definition: pricer.c:77
SCIP_RETCODE SCIPpricerExit(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:226
#define SCIP_Bool
Definition: def.h:53
#define SCIP_DECL_PRICERINITSOL(x)
Definition: type_pricer.h:81
void SCIPpricerSetCopy(SCIP_PRICER *pricer, SCIP_DECL_PRICERCOPY((*pricercopy)))
Definition: pricer.c:484
public methods for variable pricers
type definitions for storing and manipulating the main problem
SCIP_RETCODE SCIPpricerCreate(SCIP_PRICER **pricer, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_Bool delay, SCIP_DECL_PRICERCOPY((*pricercopy)), SCIP_DECL_PRICERFREE((*pricerfree)), SCIP_DECL_PRICERINIT((*pricerinit)), SCIP_DECL_PRICEREXIT((*pricerexit)), SCIP_DECL_PRICERINITSOL((*pricerinitsol)), SCIP_DECL_PRICEREXITSOL((*pricerexitsol)), SCIP_DECL_PRICERREDCOST((*pricerredcost)), SCIP_DECL_PRICERFARKAS((*pricerfarkas)), SCIP_PRICERDATA *pricerdata)
Definition: pricer.c:99
SCIP_RETCODE SCIPpricerExec(SCIP_PRICER *pricer, SCIP_SET *set, SCIP_PROB *prob, SCIP_LP *lp, SCIP_PRICESTORE *pricestore, SCIP_Real *lowerbound, SCIP_Bool *stopearly, SCIP_RESULT *result)
Definition: pricer.c:424
SCIP_RETCODE SCIPpricerExitsol(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:281
#define SCIP_Real
Definition: def.h:127
result codes for SCIP callback methods
SCIP_RETCODE SCIPpricerFarkas(SCIP_PRICER *pricer, SCIP_SET *set, SCIP_PROB *prob, SCIP_RESULT *result)
Definition: pricer.c:385
SCIP_RETCODE SCIPpricerDeactivate(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:325
void SCIPpricerSetExitsol(SCIP_PRICER *pricer, SCIP_DECL_PRICEREXITSOL((*pricerexitsol)))
Definition: pricer.c:539
void SCIPpricerSetInitsol(SCIP_PRICER *pricer, SCIP_DECL_PRICERINITSOL((*pricerinitsol)))
Definition: pricer.c:528
struct SCIP_PricerData SCIP_PRICERDATA
Definition: type_pricer.h:36
#define SCIP_DECL_PRICERFREE(x)
Definition: type_pricer.h:54
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:392
#define SCIP_DECL_PRICERREDCOST(x)
Definition: type_pricer.h:130
SCIP_RETCODE SCIPpricerInitsol(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:257
memory allocation routines