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-2020 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 scipopt.org. */
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 */
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 */
53  SCIP_PRICER** pricer, /**< pointer to variable pricer data structure */
54  SCIP_SET* set, /**< global SCIP settings */
55  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
56  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
57  const char* name, /**< name of variable pricer */
58  const char* desc, /**< description of variable pricer */
59  int priority, /**< priority of the variable pricer */
60  SCIP_Bool delay, /**< should the pricer be delayed until no other pricers or already existing
61  * problem variables with negative reduced costs are found */
62  SCIP_DECL_PRICERCOPY ((*pricercopy)), /**< copy method of pricer or NULL if you don't want to copy your plugin into sub-SCIPs */
63  SCIP_DECL_PRICERFREE ((*pricerfree)), /**< destructor of variable pricer */
64  SCIP_DECL_PRICERINIT ((*pricerinit)), /**< initialize variable pricer */
65  SCIP_DECL_PRICEREXIT ((*pricerexit)), /**< deinitialize variable pricer */
66  SCIP_DECL_PRICERINITSOL((*pricerinitsol)),/**< solving process initialization method of variable pricer */
67  SCIP_DECL_PRICEREXITSOL((*pricerexitsol)),/**< solving process deinitialization method of variable pricer */
68  SCIP_DECL_PRICERREDCOST((*pricerredcost)),/**< reduced cost pricing method of variable pricer for feasible LPs */
69  SCIP_DECL_PRICERFARKAS((*pricerfarkas)), /**< Farkas pricing method of variable pricer for infeasible LPs */
70  SCIP_PRICERDATA* pricerdata /**< variable pricer data */
71  );
72 
73 /** calls destructor and frees memory of variable pricer */
75  SCIP_PRICER** pricer, /**< pointer to variable pricer data structure */
76  SCIP_SET* set /**< global SCIP settings */
77  );
78 
79 /** initializes variable pricer */
81  SCIP_PRICER* pricer, /**< variable pricer */
82  SCIP_SET* set /**< global SCIP settings */
83  );
84 
85 /** calls exit method of variable pricer */
87  SCIP_PRICER* pricer, /**< variable pricer */
88  SCIP_SET* set /**< global SCIP settings */
89  );
90 
91 /** informs variable pricer that the branch and bound process is being started */
93  SCIP_PRICER* pricer, /**< variable pricer */
94  SCIP_SET* set /**< global SCIP settings */
95  );
96 
97 /** informs variable pricer that the branch and bound process data is being freed */
99  SCIP_PRICER* pricer, /**< variable pricer */
100  SCIP_SET* set /**< global SCIP settings */
101  );
102 
103 /** activates pricer such that it is called in LP solving loop */
105  SCIP_PRICER* pricer, /**< variable pricer */
106  SCIP_SET* set /**< global SCIP settings */
107  );
108 
109 /** deactivates pricer such that it is no longer called in LP solving loop */
111  SCIP_PRICER* pricer, /**< variable pricer */
112  SCIP_SET* set /**< global SCIP settings */
113  );
114 
115 /** enables or disables all clocks of \p pricer, depending on the value of the flag */
117  SCIP_PRICER* pricer, /**< the pricer for which all clocks should be enabled or disabled */
118  SCIP_Bool enable /**< should the clocks of the pricer be enabled? */
119  );
120 
121 /** calls reduced cost pricing method of variable pricer */
123  SCIP_PRICER* pricer, /**< variable pricer */
124  SCIP_SET* set, /**< global SCIP settings */
125  SCIP_PROB* prob, /**< transformed problem */
126  SCIP_Real* lowerbound, /**< local lower bound computed by the pricer */
127  SCIP_Bool* stopearly, /**< should pricing be stopped, although new variables were added? */
128  SCIP_RESULT* result /**< result of the pricing process */
129  );
130 
131 /** calls Farkas pricing method of variable pricer */
133  SCIP_PRICER* pricer, /**< variable pricer */
134  SCIP_SET* set, /**< global SCIP settings */
135  SCIP_PROB* prob, /**< transformed problem */
136  SCIP_RESULT* result /**< result of the pricing process */
137  );
138 
139 /** depending on the LP's solution status, calls reduced cost or Farkas pricing method of variable pricer */
141  SCIP_PRICER* pricer, /**< variable pricer */
142  SCIP_SET* set, /**< global SCIP settings */
143  SCIP_PROB* prob, /**< transformed problem */
144  SCIP_LP* lp, /**< LP data */
145  SCIP_PRICESTORE* pricestore, /**< pricing storage */
146  SCIP_Real* lowerbound, /**< local lower bound computed by the pricer */
147  SCIP_Bool* stopearly, /**< should pricing be stopped, although new variables were added? */
148  SCIP_RESULT* result /**< result of the pricing process */
149  );
150 
151 /** sets priority of variable pricer */
153  SCIP_PRICER* pricer, /**< variable pricer */
154  SCIP_SET* set, /**< global SCIP settings */
155  int priority /**< new priority of the variable pricer */
156  );
157 
158 /** sets copy callback of pricer */
159 void SCIPpricerSetCopy(
160  SCIP_PRICER* pricer, /**< variable pricer */
161  SCIP_DECL_PRICERCOPY ((*pricercopy)) /**< copy callback of pricer */
162  );
163 
164 /** sets destructor callback of pricer */
165 void SCIPpricerSetFree(
166  SCIP_PRICER* pricer, /**< pricer */
167  SCIP_DECL_PRICERFREE ((*pricerfree)) /**< destructor of pricer */
168  );
169 
170 /** sets initialization callback of pricer */
171 void SCIPpricerSetInit(
172  SCIP_PRICER* pricer, /**< pricer */
173  SCIP_DECL_PRICERINIT ((*pricerinit)) /**< initialize pricer */
174  );
175 
176 /** sets deinitialization callback of pricer */
177 void SCIPpricerSetExit(
178  SCIP_PRICER* pricer, /**< pricer */
179  SCIP_DECL_PRICEREXIT ((*pricerexit)) /**< deinitialize pricer */
180  );
181 
182 /** sets solving process initialization callback of pricer */
184  SCIP_PRICER* pricer, /**< pricer */
185  SCIP_DECL_PRICERINITSOL ((*pricerinitsol))/**< solving process initialization callback of pricer */
186  );
187 
188 /** sets solving process deinitialization callback of pricer */
190  SCIP_PRICER* pricer, /**< pricer */
191  SCIP_DECL_PRICEREXITSOL ((*pricerexitsol))/**< solving process deinitialization callback of pricer */
192  );
193 
194 #ifdef __cplusplus
195 }
196 #endif
197 
198 #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:225
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:198
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:54
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:344
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:78
SCIP_DECL_PRICERFARKAS(ObjPricerVRP::scip_farkas)
Definition: pricer_vrp.cpp:237
SCIP_RETCODE SCIPpricerExit(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:265
SCIP_DECL_PRICERREDCOST(ObjPricerVRP::scip_redcost)
Definition: pricer_vrp.cpp:216
#define SCIP_Bool
Definition: def.h:70
#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:164
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:320
#define SCIP_Real
Definition: def.h:163
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:364
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:429
SCIP_RETCODE SCIPpricerInitsol(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:296
memory allocation routines