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-2019 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 visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file pricer.h
17  * @ingroup INTERNALAPI
18  * @brief internal methods for variable pricers
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_PRICER_H__
25 #define __SCIP_PRICER_H__
26 
27 
28 #include "scip/def.h"
29 #include "blockmemshell/memory.h"
30 #include "scip/type_retcode.h"
31 #include "scip/type_result.h"
32 #include "scip/type_set.h"
33 #include "scip/type_lp.h"
34 #include "scip/type_prob.h"
35 #include "scip/type_pricestore.h"
36 #include "scip/type_pricer.h"
37 #include "scip/pub_pricer.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 
44 /** copies the given pricer to a new scip */
45 extern
47  SCIP_PRICER* pricer, /**< pricer */
48  SCIP_SET* set, /**< SCIP_SET of SCIP to copy to */
49  SCIP_Bool* valid /**< was the copying process valid? */
50  );
51 
52 /** creates a variable pricer */
53 extern
55  SCIP_PRICER** pricer, /**< pointer to variable pricer data structure */
56  SCIP_SET* set, /**< global SCIP settings */
57  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
58  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
59  const char* name, /**< name of variable pricer */
60  const char* desc, /**< description of variable pricer */
61  int priority, /**< priority of the variable pricer */
62  SCIP_Bool delay, /**< should the pricer be delayed until no other pricers or already existing
63  * problem variables with negative reduced costs are found */
64  SCIP_DECL_PRICERCOPY ((*pricercopy)), /**< copy method of pricer or NULL if you don't want to copy your plugin into sub-SCIPs */
65  SCIP_DECL_PRICERFREE ((*pricerfree)), /**< destructor of variable pricer */
66  SCIP_DECL_PRICERINIT ((*pricerinit)), /**< initialize variable pricer */
67  SCIP_DECL_PRICEREXIT ((*pricerexit)), /**< deinitialize variable pricer */
68  SCIP_DECL_PRICERINITSOL((*pricerinitsol)),/**< solving process initialization method of variable pricer */
69  SCIP_DECL_PRICEREXITSOL((*pricerexitsol)),/**< solving process deinitialization method of variable pricer */
70  SCIP_DECL_PRICERREDCOST((*pricerredcost)),/**< reduced cost pricing method of variable pricer for feasible LPs */
71  SCIP_DECL_PRICERFARKAS((*pricerfarkas)), /**< Farkas pricing method of variable pricer for infeasible LPs */
72  SCIP_PRICERDATA* pricerdata /**< variable pricer data */
73  );
74 
75 /** calls destructor and frees memory of variable pricer */
76 extern
78  SCIP_PRICER** pricer, /**< pointer to variable pricer data structure */
79  SCIP_SET* set /**< global SCIP settings */
80  );
81 
82 /** initializes variable pricer */
83 extern
85  SCIP_PRICER* pricer, /**< variable pricer */
86  SCIP_SET* set /**< global SCIP settings */
87  );
88 
89 /** calls exit method of variable pricer */
90 extern
92  SCIP_PRICER* pricer, /**< variable pricer */
93  SCIP_SET* set /**< global SCIP settings */
94  );
95 
96 /** informs variable pricer that the branch and bound process is being started */
97 extern
99  SCIP_PRICER* pricer, /**< variable pricer */
100  SCIP_SET* set /**< global SCIP settings */
101  );
102 
103 /** informs variable pricer that the branch and bound process data is being freed */
104 extern
106  SCIP_PRICER* pricer, /**< variable pricer */
107  SCIP_SET* set /**< global SCIP settings */
108  );
109 
110 /** activates pricer such that it is called in LP solving loop */
111 extern
113  SCIP_PRICER* pricer, /**< variable pricer */
114  SCIP_SET* set /**< global SCIP settings */
115  );
116 
117 /** deactivates pricer such that it is no longer called in LP solving loop */
118 extern
120  SCIP_PRICER* pricer, /**< variable pricer */
121  SCIP_SET* set /**< global SCIP settings */
122  );
123 
124 /** enables or disables all clocks of \p pricer, depending on the value of the flag */
125 extern
127  SCIP_PRICER* pricer, /**< the pricer for which all clocks should be enabled or disabled */
128  SCIP_Bool enable /**< should the clocks of the pricer be enabled? */
129  );
130 
131 /** calls reduced cost pricing method of variable pricer */
132 extern
134  SCIP_PRICER* pricer, /**< variable pricer */
135  SCIP_SET* set, /**< global SCIP settings */
136  SCIP_PROB* prob, /**< transformed problem */
137  SCIP_Real* lowerbound, /**< local lower bound computed by the pricer */
138  SCIP_Bool* stopearly, /**< should pricing be stopped, although new variables were added? */
139  SCIP_RESULT* result /**< result of the pricing process */
140  );
141 
142 /** calls Farkas pricing method of variable pricer */
143 extern
145  SCIP_PRICER* pricer, /**< variable pricer */
146  SCIP_SET* set, /**< global SCIP settings */
147  SCIP_PROB* prob, /**< transformed problem */
148  SCIP_RESULT* result /**< result of the pricing process */
149  );
150 
151 /** depending on the LP's solution status, calls reduced cost or Farkas pricing method of variable pricer */
152 extern
154  SCIP_PRICER* pricer, /**< variable pricer */
155  SCIP_SET* set, /**< global SCIP settings */
156  SCIP_PROB* prob, /**< transformed problem */
157  SCIP_LP* lp, /**< LP data */
158  SCIP_PRICESTORE* pricestore, /**< pricing storage */
159  SCIP_Real* lowerbound, /**< local lower bound computed by the pricer */
160  SCIP_Bool* stopearly, /**< should pricing be stopped, although new variables were added? */
161  SCIP_RESULT* result /**< result of the pricing process */
162  );
163 
164 /** sets priority of variable pricer */
165 extern
167  SCIP_PRICER* pricer, /**< variable pricer */
168  SCIP_SET* set, /**< global SCIP settings */
169  int priority /**< new priority of the variable pricer */
170  );
171 
172 /** sets copy callback of pricer */
173 extern
174 void SCIPpricerSetCopy(
175  SCIP_PRICER* pricer, /**< variable pricer */
176  SCIP_DECL_PRICERCOPY ((*pricercopy)) /**< copy callback of pricer */
177  );
178 
179 /** sets destructor callback of pricer */
180 extern
181 void SCIPpricerSetFree(
182  SCIP_PRICER* pricer, /**< pricer */
183  SCIP_DECL_PRICERFREE ((*pricerfree)) /**< destructor of pricer */
184  );
185 
186 /** sets initialization callback of pricer */
187 extern
188 void SCIPpricerSetInit(
189  SCIP_PRICER* pricer, /**< pricer */
190  SCIP_DECL_PRICERINIT ((*pricerinit)) /**< initialize pricer */
191  );
192 
193 /** sets deinitialization callback of pricer */
194 extern
195 void SCIPpricerSetExit(
196  SCIP_PRICER* pricer, /**< pricer */
197  SCIP_DECL_PRICEREXIT ((*pricerexit)) /**< deinitialize pricer */
198  );
199 
200 /** sets solving process initialization callback of pricer */
201 extern
203  SCIP_PRICER* pricer, /**< pricer */
204  SCIP_DECL_PRICERINITSOL ((*pricerinitsol))/**< solving process initialization callback of pricer */
205  );
206 
207 /** sets solving process deinitialization callback of pricer */
208 extern
210  SCIP_PRICER* pricer, /**< pricer */
211  SCIP_DECL_PRICEREXITSOL ((*pricerexitsol))/**< solving process deinitialization callback of pricer */
212  );
213 
214 #ifdef __cplusplus
215 }
216 #endif
217 
218 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
void SCIPpricerSetFree(SCIP_PRICER *pricer, SCIP_DECL_PRICERFREE((*pricerfree)))
Definition: pricer.c:533
SCIP_RETCODE SCIPpricerRedcost(SCIP_PRICER *pricer, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real *lowerbound, SCIP_Bool *stopearly, SCIP_RESULT *result)
Definition: pricer.c:383
SCIP_RETCODE SCIPpricerInit(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:224
void SCIPpricerSetExit(SCIP_PRICER *pricer, SCIP_DECL_PRICEREXIT((*pricerexit)))
Definition: pricer.c:555
#define SCIP_DECL_PRICEREXIT(x)
Definition: type_pricer.h:70
void SCIPpricerEnableOrDisableClocks(SCIP_PRICER *pricer, SCIP_Bool enable)
Definition: pricer.c:672
SCIP_RETCODE SCIPpricerFree(SCIP_PRICER **pricer, SCIP_SET *set)
Definition: pricer.c:197
type definitions for storing priced variables
void SCIPpricerSetInit(SCIP_PRICER *pricer, SCIP_DECL_PRICERINIT((*pricerinit)))
Definition: pricer.c:544
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:343
void SCIPpricerSetPriority(SCIP_PRICER *pricer, SCIP_SET *set, int priority)
Definition: pricer.c:618
SCIP_DECL_PRICERINIT(ObjPricerVRP::scip_init)
Definition: pricer_vrp.cpp:74
SCIP_RETCODE SCIPpricerCopyInclude(SCIP_PRICER *pricer, SCIP_SET *set, SCIP_Bool *valid)
Definition: pricer.c:77
SCIP_DECL_PRICERFARKAS(ObjPricerVRP::scip_farkas)
Definition: pricer_vrp.cpp:237
SCIP_RETCODE SCIPpricerExit(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:264
SCIP_DECL_PRICERREDCOST(ObjPricerVRP::scip_redcost)
Definition: pricer_vrp.cpp:216
#define SCIP_Bool
Definition: def.h:69
#define SCIP_DECL_PRICERINITSOL(x)
Definition: type_pricer.h:81
void SCIPpricerSetCopy(SCIP_PRICER *pricer, SCIP_DECL_PRICERCOPY((*pricercopy)))
Definition: pricer.c:522
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:163
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:462
SCIP_RETCODE SCIPpricerExitsol(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:319
#define SCIP_Real
Definition: def.h:157
result codes for SCIP callback methods
SCIP_RETCODE SCIPpricerFarkas(SCIP_PRICER *pricer, SCIP_SET *set, SCIP_PROB *prob, SCIP_RESULT *result)
Definition: pricer.c:423
SCIP_RETCODE SCIPpricerDeactivate(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:363
void SCIPpricerSetExitsol(SCIP_PRICER *pricer, SCIP_DECL_PRICEREXITSOL((*pricerexitsol)))
Definition: pricer.c:577
void SCIPpricerSetInitsol(SCIP_PRICER *pricer, SCIP_DECL_PRICERINITSOL((*pricerinitsol)))
Definition: pricer.c:566
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:426
SCIP_RETCODE SCIPpricerInitsol(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:295
memory allocation routines