GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
pricingcb.c
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
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-2026 Operations Research, RWTH Aachen University */
10/* Zuse Institute Berlin (ZIB) */
11/* */
12/* Licensed under the Apache License, Version 2.0 (the "License"); */
13/* you may not use this file except in compliance with the License. */
14/* You may obtain a copy of the License at */
15/* */
16/* http://www.apache.org/licenses/LICENSE-2.0 */
17/* */
18/* Unless required by applicable law or agreed to in writing, software */
19/* distributed under the License is distributed on an "AS IS" BASIS, */
20/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
21/* See the License for the specific language governing permissions and */
22/* limitations under the License. */
23/* */
24/* You should have received a copy of the Apache-2.0 license */
25/* along with GCG; see the file LICENSE. If not visit gcg.or.rwth-aachen.de.*/
26/* */
27/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28
29/**@file pricingcb.c
30 * @ingroup OTHER_CFILES
31 * @brief methods for pricing callback
32 * @author Stephen J. Maher
33 */
34
35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
36
37#include <assert.h>
38#include <string.h>
39
40#include "gcg/gcg.h"
41
42#include "scip/def.h"
43#include "scip/set.h"
44#include "scip/clock.h"
45#include "scip/paramset.h"
46#include "scip/scip.h"
47#include "scip/pub_message.h"
48
49#include "gcg/pricingcb.h"
51
52/* default parameter settings for the pricing callbacks */
53#define GCG_DEFAULT_ENABLED FALSE
54#define GCG_DEFAULT_EXCLUSIVE FALSE
55
56/** compares two pricing callbacks w.r.t their priority */
57SCIP_DECL_SORTPTRCOMP(GCGpricingcbComp)
58{ /*lint --e{715}*/
59 GCG_PRICINGCB* pricingcb1 = (GCG_PRICINGCB*)elem1;
60 GCG_PRICINGCB* pricingcb2 = (GCG_PRICINGCB*)elem2;
61
62 assert(pricingcb1 != NULL);
63 assert(pricingcb2 != NULL);
64
65 return pricingcb2->priority - pricingcb1->priority; /* prefer higher priorities */
66}
67
68/** comparison method for sorting pricing callbacks w.r.t their name */
69SCIP_DECL_SORTPTRCOMP(GCGpricingcbCompName)
70{
72}
73
74/** internal method for creating a pricing callback structure */
75static
77 SCIP* scip, /**< SCIP data structure */
78 GCG_PRICINGCB** pricingcb, /**< pointer to the pricing callback data structure */
79 const char* name, /**< name of the pricing callback */
80 const char* desc, /**< description of the pricing callback */
81 int priority, /**< priority of the the pricing callback */
82 GCG_DECL_PRICINGCBFREE((*pricingcbfree)), /**< destructor of the pricing callback */
83 GCG_DECL_PRICINGCBINIT((*pricingcbinit)), /**< initialize the pricing callback */
84 GCG_DECL_PRICINGCBEXIT((*pricingcbexit)), /**< deinitialize the pricing callback */
85 GCG_DECL_PRICINGCBINITSOL((*pricingcbinitsol)),/**< solving process initialization method of the pricing callback */
86 GCG_DECL_PRICINGCBEXITSOL((*pricingcbexitsol)),/**< solving process deinitialization method of the pricing callback */
87 GCG_DECL_PRICINGCBPREPRICING((*pricingcbprepricing)),/**< pre-pricing method of the pricing callback */
88 GCG_DECL_PRICINGCBPOSTPRICING((*pricingcbpostpricing)),/**< post-pricing method of the pricing callback */
89 GCG_PRICINGCBDATA* pricingcbdata /**< pricing callback data */
90 )
91{
92 char paramname[SCIP_MAXSTRLEN];
93 char paramdesc[SCIP_MAXSTRLEN];
94
95 assert(scip != NULL);
96 assert(pricingcb != NULL);
97 assert(name != NULL);
98 assert(desc != NULL);
99
100 SCIP_ALLOC( BMSallocMemory(pricingcb) );
101 SCIP_ALLOC( BMSduplicateMemoryArray(&(*pricingcb)->name, name, strlen(name)+1) );
102 SCIP_ALLOC( BMSduplicateMemoryArray(&(*pricingcb)->desc, desc, strlen(desc)+1) );
103 (*pricingcb)->priority = priority;
104 (*pricingcb)->pricingcbfree = pricingcbfree;
105 (*pricingcb)->pricingcbinit = pricingcbinit;
106 (*pricingcb)->pricingcbexit = pricingcbexit;
107 (*pricingcb)->pricingcbinitsol = pricingcbinitsol;
108 (*pricingcb)->pricingcbexitsol = pricingcbexitsol;
109 (*pricingcb)->pricingcbprepricing = pricingcbprepricing;
110 (*pricingcb)->pricingcbpostpricing = pricingcbpostpricing;
111 (*pricingcb)->pricingcbdata = pricingcbdata;
112 SCIP_CALL( SCIPcreateClock(scip, &(*pricingcb)->setuptime) );
113 SCIP_CALL( SCIPcreateClock(scip, &(*pricingcb)->pricingcbclock) );
114 (*pricingcb)->nprepricingcalls = 0;
115 (*pricingcb)->npostpricingcalls = 0;
116
117 /* add parameters */
118 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "pricingcb/%s/priority", name);
119 (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of the pricing callback <%s>", name);
120 SCIP_CALL( SCIPaddIntParam(scip, paramname, paramdesc,
121 &(*pricingcb)->priority, TRUE, priority, INT_MIN/4, INT_MAX/4, NULL, NULL) ); /*lint !e740*/
122
123 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "pricingcb/%s/enabled", name);
124 SCIP_CALL( SCIPaddBoolParam(scip, paramname,
125 "are the methods of this pricing callback enabled?", &(*pricingcb)->enabled, FALSE,
126 GCG_DEFAULT_ENABLED, NULL, NULL) ); /*lint !e740*/
127
128 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "pricingcb/%s/exclusive", name);
129 SCIP_CALL( SCIPaddBoolParam(scip, paramname,
130 "are the methods of this pricing callback executed exclusively (only takes effect if highest priority callback)?",
131 &(*pricingcb)->exclusive, FALSE, GCG_DEFAULT_EXCLUSIVE, NULL, NULL) ); /*lint !e740*/
132
133 return SCIP_OKAY;
134}
135
136/** creates a pricing callback */
138 GCG* gcg, /**< GCG data structure */
139 GCG_PRICINGCB** pricingcb, /**< pointer to the pricing callback data structure */
140 const char* name, /**< name of the pricing callback */
141 const char* desc, /**< description of the pricing callback */
142 int priority, /**< priority of the the pricing callback */
143 GCG_DECL_PRICINGCBFREE((*pricingcbfree)), /**< destructor of the pricing callback */
144 GCG_DECL_PRICINGCBINIT((*pricingcbinit)), /**< initialize the pricing callback */
145 GCG_DECL_PRICINGCBEXIT((*pricingcbexit)), /**< deinitialize the pricing callback */
146 GCG_DECL_PRICINGCBINITSOL((*pricingcbinitsol)),/**< solving process initialization method of the pricing callback */
147 GCG_DECL_PRICINGCBEXITSOL((*pricingcbexitsol)),/**< solving process deinitialization method of the pricing callback */
148 GCG_DECL_PRICINGCBPREPRICING((*pricingcbprepricing)),/**< pre-pricing method of the pricing callback */
149 GCG_DECL_PRICINGCBPOSTPRICING((*pricingcbpostpricing)),/**< post-pricing method of the pricing callback */
150 GCG_PRICINGCBDATA* pricingcbdata /**< pricing callback data */
151 )
152{
153 SCIP* scip;
154 assert(gcg != NULL);
155 assert(pricingcb != NULL);
156 assert(name != NULL);
157 assert(desc != NULL);
158
160 SCIP_CALL_FINALLY( doPricingcbCreate(scip, pricingcb, name, desc, priority,
161 pricingcbfree, pricingcbinit, pricingcbexit, pricingcbinitsol, pricingcbexitsol,
162 pricingcbprepricing, pricingcbpostpricing, pricingcbdata), (void)GCGpricingcbFree(gcg, pricingcb) );
163
164 return SCIP_OKAY;
165}
166
167/** calls destructor and frees memory of the pricing callback */
169 GCG* gcg, /**< GCG data structure */
170 GCG_PRICINGCB** pricingcb /**< pointer to the pricing callback data structure */
171 )
172{
173 SCIP* scip;
174 assert(gcg != NULL);
175 assert(pricingcb != NULL);
176 assert(*pricingcb != NULL);
177
179
180 /* call destructor of the pricing callback */
181 if( (*pricingcb)->pricingcbfree != NULL )
182 {
183 SCIP_CALL( (*pricingcb)->pricingcbfree(gcg, *pricingcb) );
184 }
185
186 SCIPfreeClock(scip, &(*pricingcb)->pricingcbclock);
187 SCIPfreeClock(scip, &(*pricingcb)->setuptime);
188 BMSfreeMemoryArray(&(*pricingcb)->name);
189 BMSfreeMemoryArray(&(*pricingcb)->desc);
190 BMSfreeMemory(pricingcb);
191
192 return SCIP_OKAY;
193}
194
195/** initializes the pricing callback */
197 GCG* gcg, /**< GCG data structure */
198 GCG_PRICINGCB* pricingcb /**< pricing callback */
199 )
200{
201 SCIP* scip;
202 SCIP_Bool misc_resetstat;
203
204 assert(gcg != NULL);
205 assert(pricingcb != NULL);
206
208 SCIP_CALL( SCIPgetBoolParam(scip, "misc/resetstat", &misc_resetstat) );
209
210 if( misc_resetstat )
211 {
212 SCIPresetClock(scip, pricingcb->setuptime);
214
215 pricingcb->nprepricingcalls = 0;
216 pricingcb->npostpricingcalls = 0;
217 }
218
219 if( pricingcb->pricingcbinit != NULL )
220 {
221 /* start timing */
222 SCIPstartClock(scip, pricingcb->setuptime);
223
224 SCIP_CALL( pricingcb->pricingcbinit(gcg, pricingcb) );
225
226 /* stop timing */
227 SCIPstopClock(scip, pricingcb->setuptime);
228 }
229
230 return SCIP_OKAY;
231}
232
233/** calls exit method of the pricing callback */
235 GCG* gcg, /**< GCG data structure */
236 GCG_PRICINGCB* pricingcb /**< pricing callback */
237 )
238{
239 SCIP* scip;
240 assert(gcg != NULL);
241 assert(pricingcb != NULL);
242
244
245 if( pricingcb->pricingcbexit != NULL )
246 {
247 /* start timing */
248 SCIPstartClock(scip, pricingcb->setuptime);
249
250 SCIP_CALL( pricingcb->pricingcbexit(gcg, pricingcb) );
251
252 /* stop timing */
253 SCIPstopClock(scip, pricingcb->setuptime);
254 }
255
256 return SCIP_OKAY;
257}
258
259/** informs pricing callback that the branch and bound process is being started */
261 GCG* gcg, /**< GCG data structure */
262 GCG_PRICINGCB* pricingcb /**< pricing callback */
263 )
264{
265 SCIP* scip;
266 assert(gcg != NULL);
267 assert(pricingcb != NULL);
268
270
271 /* call solving process initialization method of the pricing callback */
272 if( pricingcb->pricingcbinitsol != NULL )
273 {
274 /* start timing */
275 SCIPstartClock(scip, pricingcb->setuptime);
276
277 SCIP_CALL( pricingcb->pricingcbinitsol(gcg, pricingcb) );
278
279 /* stop timing */
280 SCIPstopClock(scip, pricingcb->setuptime);
281 }
282
283 return SCIP_OKAY;
284}
285
286/** informs pricing callback that the branch and bound process data is being freed */
288 GCG* gcg, /**< GCG data structure */
289 GCG_PRICINGCB* pricingcb /**< pricing callback */
290 )
291{
292 SCIP* scip;
293 assert(gcg != NULL);
294 assert(pricingcb != NULL);
295
297
298 /* call solving process deinitialization method of pricing callback */
299 if( pricingcb->pricingcbexitsol != NULL )
300 {
301 /* start timing */
302 SCIPstartClock(scip, pricingcb->setuptime);
303
304 SCIP_CALL( pricingcb->pricingcbexitsol(gcg, pricingcb) );
305
306 /* stop timing */
307 SCIPstopClock(scip, pricingcb->setuptime);
308 }
309
310 return SCIP_OKAY;
311}
312
313/** calls pre-pricing method of the pricing callback */
315 GCG* gcg, /**< GCG data structure */
316 GCG_PRICINGCB* pricingcb, /**< pricing callback */
317 SCIP_PRICER* pricer, /**< the pricer */
318 GCG_PRICETYPE type, /**< the type of pricing, either redcost or farkas */
319 SCIP_Bool* abort, /**< should the pricing be aborted? */
320 SCIP_RESULT* result /**< pointer to store the result of the callback method */
321 )
322{
323 SCIP* scip;
324 assert(gcg != NULL);
325 assert(pricingcb != NULL);
326 assert(pricingcb->pricingcbprepricing != NULL);
327 assert(pricer != NULL);
328 assert(abort != NULL);
329 assert(result != NULL);
330
331 /* the pricing callback should only be called if it is enabled */
332 assert(pricingcb->enabled);
333
335 (*abort) = FALSE;
336 (*result) = SCIP_DIDNOTRUN;
337
338 SCIPdebugMsg(scip, "executing the pre-pricing method of pricing callback <%s>\n", pricingcb->name);
339
340 /* start timing */
342
343 SCIP_CALL( pricingcb->pricingcbprepricing(gcg, pricingcb, pricer, type, abort, result) );
344
345 /* stop timing */
346 SCIPstopClock(scip, pricingcb->pricingcbclock);
347
348 /* evaluate result */
349 if( (*result) != SCIP_DIDNOTRUN
350 && (*result) != SCIP_SUCCESS )
351 {
352 SCIPerrorMessage("pre-pricing method of pricing callback <%s> returned invalid result <%d>\n",
353 pricingcb->name, (*result));
354 return SCIP_INVALIDRESULT;
355 }
356
357 pricingcb->nprepricingcalls++;
358
359 return SCIP_OKAY;
360}
361
362/** calls post-pricing method of the pricing callback */
364 GCG* gcg, /**< GCG data structure */
365 GCG_PRICINGCB* pricingcb, /**< pricing callback */
366 SCIP_PRICER* pricer, /**< the pricer */
367 GCG_PRICETYPE type, /**< the type of pricing, either redcost or farkas */
368 SCIP_RESULT* result /**< pointer to store the result of the callback method */
369 )
370{
371 SCIP* scip;
372 assert(gcg != NULL);
373 assert(pricingcb != NULL);
374 assert(pricingcb->pricingcbpostpricing != NULL);
375 assert(pricer != NULL);
376 assert(result != NULL);
377
379
380 /* the pricing callback should only be called if it is enabled */
381 assert(pricingcb->enabled);
382
383 (*result) = SCIP_DIDNOTRUN;
384
385 SCIPdebugMsg(scip, "executing the post-pricing method of pricing callback <%s>\n", pricingcb->name);
386
387 /* start timing */
389
390 SCIP_CALL( pricingcb->pricingcbpostpricing(gcg, pricingcb, pricer, type, result) );
391
392 /* stop timing */
393 SCIPstopClock(scip, pricingcb->pricingcbclock);
394
395 /* evaluate result */
396 if( (*result) != SCIP_DIDNOTRUN
397 && (*result) != SCIP_SUCCESS )
398 {
399 SCIPerrorMessage("post-pricing method of pricing callback <%s> returned invalid result <%d>\n",
400 pricingcb->name, (*result));
401 return SCIP_INVALIDRESULT;
402 }
403
404 pricingcb->npostpricingcalls++;
405
406 return SCIP_OKAY;
407}
408
409/** gets user data of the pricing callback */
411 GCG_PRICINGCB* pricingcb /**< pricing callback */
412 )
413{
414 assert(pricingcb != NULL);
415
416 return pricingcb->pricingcbdata;
417}
418
419/** sets user data of the pricing callback; user has to free old data in advance! */
421 GCG_PRICINGCB* pricingcb, /**< pricing callback */
422 GCG_PRICINGCBDATA* pricingcbdata /**< new pricing callback user data */
423 )
424{
425 assert(pricingcb != NULL);
426
427 pricingcb->pricingcbdata = pricingcbdata;
428}
429
430/* new callback setter methods */
431
432/** sets priority of the pricing callback */
434 GCG_PRICINGCB* pricingcb, /**< pricing callback */
435 int priority /**< new priority of the pricing callback */
436 )
437{
438 assert(pricingcb != NULL);
439 pricingcb->priority = priority;
440}
441
442/** sets destructor callback of the pricing callback */
444 GCG_PRICINGCB* pricingcb, /**< pricing callback */
445 GCG_DECL_PRICINGCBFREE((*pricingcbfree)) /**< destructor of the pricing callback */
446 )
447{
448 assert(pricingcb != NULL);
449
450 pricingcb->pricingcbfree = pricingcbfree;
451}
452
453/** sets initialization callback of the pricing callback */
455 GCG_PRICINGCB* pricingcb, /**< pricing callback */
456 GCG_DECL_PRICINGCBINIT((*pricingcbinit)) /**< initialize the pricing callback */
457 )
458{
459 assert(pricingcb != NULL);
460
461 pricingcb->pricingcbinit = pricingcbinit;
462}
463
464/** sets deinitialization callback of the pricing callback */
466 GCG_PRICINGCB* pricingcb, /**< pricing callback */
467 GCG_DECL_PRICINGCBEXIT((*pricingcbexit)) /**< deinitialize the pricing callback */
468 )
469{
470 assert(pricingcb != NULL);
471
472 pricingcb->pricingcbexit = pricingcbexit;
473}
474
475/** sets solving process initialization callback of the pricing callback */
477 GCG_PRICINGCB* pricingcb, /**< pricing callback */
478 GCG_DECL_PRICINGCBINITSOL((*pricingcbinitsol))/**< solving process initialization callback of the pricing callback */
479 )
480{
481 assert(pricingcb != NULL);
482
483 pricingcb->pricingcbinitsol = pricingcbinitsol;
484}
485
486/** sets solving process deinitialization callback of pricing callback */
488 GCG_PRICINGCB* pricingcb, /**< pricing callback */
489 GCG_DECL_PRICINGCBEXITSOL((*pricingcbexitsol))/**< solving process deinitialization callback of the pricing callback */
490 )
491{
492 assert(pricingcb != NULL);
493
494 pricingcb->pricingcbexitsol = pricingcbexitsol;
495}
496
497/** gets name of the pricing callback */
499 GCG_PRICINGCB* pricingcb /**< pricing callback */
500 )
501{
502 assert(pricingcb != NULL);
503
504 return pricingcb->name;
505}
506
507/** gets description of the pricing callback */
509 GCG_PRICINGCB* pricingcb /**< pricing callback */
510 )
511{
512 assert(pricingcb != NULL);
513
514 return pricingcb->desc;
515}
516
517/** gets priority of the pricing callback */
519 GCG_PRICINGCB* pricingcb /**< pricing callback */
520 )
521{
522 assert(pricingcb != NULL);
523
524 return pricingcb->priority;
525}
526
527/** gets the number of times the pre-pricing method of the pricing callback plugin was called */
529 GCG_PRICINGCB* pricingcb /**< pricing callback */
530 )
531{
532 assert(pricingcb != NULL);
533
534 return pricingcb->nprepricingcalls;
535}
536
537/** gets the number of times the post-pricing method of the pricing callback plugin was called */
539 GCG_PRICINGCB* pricingcb /**< pricing callback */
540 )
541{
542 assert(pricingcb != NULL);
543
544 return pricingcb->npostpricingcalls;
545}
546
547/** gets time in seconds used by this pricing callback for setting up */
549 GCG* gcg, /**< GCG data structure */
550 GCG_PRICINGCB* pricingcb /**< pricing callback */
551 )
552{
553 assert(pricingcb != NULL);
554
555 return SCIPgetClockTime(GCGgetMasterprob(gcg), pricingcb->setuptime);
556}
557
558/** gets time in seconds used in this pricing callback */
560 GCG* gcg, /**< GCG data structure */
561 GCG_PRICINGCB* pricingcb /**< pricing callback */
562 )
563{
564 assert(pricingcb != NULL);
565
567}
568
569/** sets the enabled flag of the pricing callback method */
571 GCG_PRICINGCB* pricingcb, /**< pricing callback */
572 SCIP_Bool enabled /**< flag to indicate whether the pricing callback is enabled */
573 )
574{
575 assert(pricingcb != NULL);
576
577 pricingcb->enabled = enabled;
578}
579
580/** sets the exclusive flag of the pricing callback plugin method */
582 GCG_PRICINGCB* pricingcb, /**< pricing callback */
583 SCIP_Bool exclusive /**< flag to indicate whether the pricing callback plugin is executed exclusively */
584 )
585{
586 assert(pricingcb != NULL);
587
588 pricingcb->exclusive = exclusive;
589}
590
591/** returns whether the pricing callback is enabled */
593 GCG_PRICINGCB* pricingcb /**< pricing callback */
594 )
595{
596 assert(pricingcb != NULL);
597
598 return pricingcb->enabled;
599}
600
601/** returns whether the methods of this pricing callback should be executed exclusively */
603 GCG_PRICINGCB* pricingcb /**< pricing callback */
604 )
605{
606 assert(pricingcb != NULL);
607
608 return pricingcb->exclusive;
609}
#define SCIP_MAXSTRLEN
#define SCIP_Longint
#define SCIP_Bool
#define SCIP_ALLOC(x)
#define SCIP_Real
#define SCIP_CALL_FINALLY(x, y)
#define TRUE
#define FALSE
GCG interface methods.
SCIP * GCGgetMasterprob(GCG *gcg)
Definition gcg.cpp:99
#define SCIPdebugMsg
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_DECL_SORTPTRCOMP(SCIPbendersComp)
SCIP_Real GCGpricingcbGetSetupTime(GCG *gcg, GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:548
void GCGpricingcbSetExclusive(GCG_PRICINGCB *pricingcb, SCIP_Bool exclusive)
Definition pricingcb.c:581
SCIP_Real GCGpricingcbGetTime(GCG *gcg, GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:559
const char * GCGpricingcbGetDesc(GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:508
SCIP_Bool GCGpricingcbIsEnabled(GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:592
void GCGpricingcbSetData(GCG_PRICINGCB *pricingcb, GCG_PRICINGCBDATA *pricingcbdata)
Definition pricingcb.c:420
SCIP_Bool GCGpricingcbIsExclusive(GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:602
const char * GCGpricingcbGetName(GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:498
SCIP_Longint GCGpricingcbGetNPostpricingCalls(GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:538
GCG_PRICINGCBDATA * GCGpricingcbGetData(GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:410
int GCGpricingcbGetPriority(GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:518
SCIP_Longint GCGpricingcbGetNPrepricingCalls(GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:528
void GCGpricingcbSetEnabled(GCG_PRICINGCB *pricingcb, SCIP_Bool enabled)
Definition pricingcb.c:570
SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_RETCODE SCIPresetClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_Real SCIPgetClockTime(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
int SCIPsnprintf(char *t, int len, const char *s,...)
static assert(heur !=NULL)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
* result
#define NULL
#define BMSfreeMemory(ptr)
#define BMSduplicateMemoryArray(ptr, source, num)
#define BMSfreeMemoryArray(ptr)
#define BMSallocMemory(ptr)
#define GCG_DEFAULT_EXCLUSIVE
Definition pricingcb.c:54
SCIP_RETCODE GCGpricingcbExit(GCG *gcg, GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:234
void GCGpricingcbSetExitsol(GCG_PRICINGCB *pricingcb,)
Definition pricingcb.c:487
void GCGpricingcbSetInitsol(GCG_PRICINGCB *pricingcb,)
Definition pricingcb.c:476
static SCIP_RETCODE doPricingcbCreate(SCIP *scip, GCG_PRICINGCB **pricingcb, const char *name, const char *desc, int priority, GCG_DECL_PRICINGCBFREE((*pricingcbfree)), GCG_DECL_PRICINGCBINIT((*pricingcbinit)), GCG_DECL_PRICINGCBEXIT((*pricingcbexit)), GCG_DECL_PRICINGCBINITSOL((*pricingcbinitsol)), GCG_DECL_PRICINGCBEXITSOL((*pricingcbexitsol)), GCG_DECL_PRICINGCBPREPRICING((*pricingcbprepricing)), GCG_DECL_PRICINGCBPOSTPRICING((*pricingcbpostpricing)), GCG_PRICINGCBDATA *pricingcbdata)
Definition pricingcb.c:76
SCIP_RETCODE GCGpricingcbInit(GCG *gcg, GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:196
SCIP_RETCODE GCGpricingcbFree(GCG *gcg, GCG_PRICINGCB **pricingcb)
Definition pricingcb.c:168
#define GCG_DEFAULT_ENABLED
Definition pricingcb.c:53
SCIP_RETCODE GCGpricingcbCreate(GCG *gcg, GCG_PRICINGCB **pricingcb, const char *name, const char *desc, int priority, GCG_DECL_PRICINGCBFREE((*pricingcbfree)), GCG_DECL_PRICINGCBINIT((*pricingcbinit)), GCG_DECL_PRICINGCBEXIT((*pricingcbexit)), GCG_DECL_PRICINGCBINITSOL((*pricingcbinitsol)), GCG_DECL_PRICINGCBEXITSOL((*pricingcbexitsol)), GCG_DECL_PRICINGCBPREPRICING((*pricingcbprepricing)), GCG_DECL_PRICINGCBPOSTPRICING((*pricingcbpostpricing)), GCG_PRICINGCBDATA *pricingcbdata)
Definition pricingcb.c:137
SCIP_RETCODE GCGpricingcbInitsol(GCG *gcg, GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:260
void GCGpricingcbSetFree(GCG_PRICINGCB *pricingcb,)
Definition pricingcb.c:443
void GCGpricingcbSetInit(GCG_PRICINGCB *pricingcb,)
Definition pricingcb.c:454
SCIP_RETCODE GCGpricingcbPrepricing(GCG *gcg, GCG_PRICINGCB *pricingcb, SCIP_PRICER *pricer, GCG_PRICETYPE type, SCIP_Bool *abort, SCIP_RESULT *result)
Definition pricingcb.c:314
void GCGpricingcbSetExit(GCG_PRICINGCB *pricingcb,)
Definition pricingcb.c:465
void GCGpricingcbSetPriority(GCG_PRICINGCB *pricingcb, int priority)
Definition pricingcb.c:433
SCIP_RETCODE GCGpricingcbPostpricing(GCG *gcg, GCG_PRICINGCB *pricingcb, SCIP_PRICER *pricer, GCG_PRICETYPE type, SCIP_RESULT *result)
Definition pricingcb.c:363
SCIP_RETCODE GCGpricingcbExitsol(GCG *gcg, GCG_PRICINGCB *pricingcb)
Definition pricingcb.c:287
internal methods for the pricing callback
#define SCIPerrorMessage
SCIP_Longint nprepricingcalls
SCIP_Bool exclusive
SCIP_CLOCK * setuptime
SCIP_CLOCK * pricingcbclock
SCIP_Longint npostpricingcalls
GCG_PRICINGCBDATA * pricingcbdata
data structure for pricing callbacks
struct Gcg GCG
Definition type_gcg.h:44
struct SCIP_Pricer SCIP_PRICER
enum GCG_Pricetype GCG_PRICETYPE
#define GCG_DECL_PRICINGCBPREPRICING(x)
#define GCG_DECL_PRICINGCBPOSTPRICING(x)
#define GCG_DECL_PRICINGCBINITSOL(x)
struct GCG_PricingcbData GCG_PRICINGCBDATA
#define GCG_DECL_PRICINGCBEXIT(x)
#define GCG_DECL_PRICINGCBINIT(x)
#define GCG_DECL_PRICINGCBEXITSOL(x)
struct GCG_Pricingcb GCG_PRICINGCB
#define GCG_DECL_PRICINGCBFREE(x)
SCIP_DIDNOTRUN
SCIP_SUCCESS
enum SCIP_Result SCIP_RESULT
SCIP_INVALIDRESULT
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP