GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
pricingcb.c File Reference

Detailed Description

methods for pricing callback

Author
Stephen J. Maher

Definition in file pricingcb.c.

#include <assert.h>
#include <string.h>
#include "gcg/gcg.h"
#include "scip/def.h"
#include "scip/set.h"
#include "scip/clock.h"
#include "scip/paramset.h"
#include "scip/scip.h"
#include "scip/pub_message.h"
#include "gcg/pricingcb.h"
#include "gcg/struct_pricingcb.h"

Go to the source code of this file.

Macros

#define GCG_DEFAULT_ENABLED   FALSE
#define GCG_DEFAULT_EXCLUSIVE   FALSE

Functions

 SCIP_DECL_SORTPTRCOMP (GCGpricingcbComp)
 SCIP_DECL_SORTPTRCOMP (GCGpricingcbCompName)
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)
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)
SCIP_RETCODE GCGpricingcbFree (GCG *gcg, GCG_PRICINGCB **pricingcb)
SCIP_RETCODE GCGpricingcbInit (GCG *gcg, GCG_PRICINGCB *pricingcb)
SCIP_RETCODE GCGpricingcbExit (GCG *gcg, GCG_PRICINGCB *pricingcb)
SCIP_RETCODE GCGpricingcbInitsol (GCG *gcg, GCG_PRICINGCB *pricingcb)
SCIP_RETCODE GCGpricingcbExitsol (GCG *gcg, GCG_PRICINGCB *pricingcb)
SCIP_RETCODE GCGpricingcbPrepricing (GCG *gcg, GCG_PRICINGCB *pricingcb, SCIP_PRICER *pricer, GCG_PRICETYPE type, SCIP_Bool *abort, SCIP_RESULT *result)
SCIP_RETCODE GCGpricingcbPostpricing (GCG *gcg, GCG_PRICINGCB *pricingcb, SCIP_PRICER *pricer, GCG_PRICETYPE type, SCIP_RESULT *result)
GCG_PRICINGCBDATA * GCGpricingcbGetData (GCG_PRICINGCB *pricingcb)
void GCGpricingcbSetData (GCG_PRICINGCB *pricingcb, GCG_PRICINGCBDATA *pricingcbdata)
void GCGpricingcbSetPriority (GCG_PRICINGCB *pricingcb, int priority)
void GCGpricingcbSetFree (GCG_PRICINGCB *pricingcb,)
void GCGpricingcbSetInit (GCG_PRICINGCB *pricingcb,)
void GCGpricingcbSetExit (GCG_PRICINGCB *pricingcb,)
void GCGpricingcbSetInitsol (GCG_PRICINGCB *pricingcb,)
void GCGpricingcbSetExitsol (GCG_PRICINGCB *pricingcb,)
const char * GCGpricingcbGetName (GCG_PRICINGCB *pricingcb)
const char * GCGpricingcbGetDesc (GCG_PRICINGCB *pricingcb)
int GCGpricingcbGetPriority (GCG_PRICINGCB *pricingcb)
SCIP_Longint GCGpricingcbGetNPrepricingCalls (GCG_PRICINGCB *pricingcb)
SCIP_Longint GCGpricingcbGetNPostpricingCalls (GCG_PRICINGCB *pricingcb)
SCIP_Real GCGpricingcbGetSetupTime (GCG *gcg, GCG_PRICINGCB *pricingcb)
SCIP_Real GCGpricingcbGetTime (GCG *gcg, GCG_PRICINGCB *pricingcb)
void GCGpricingcbSetEnabled (GCG_PRICINGCB *pricingcb, SCIP_Bool enabled)
void GCGpricingcbSetExclusive (GCG_PRICINGCB *pricingcb, SCIP_Bool exclusive)
SCIP_Bool GCGpricingcbIsEnabled (GCG_PRICINGCB *pricingcb)
SCIP_Bool GCGpricingcbIsExclusive (GCG_PRICINGCB *pricingcb)

Macro Definition Documentation

◆ GCG_DEFAULT_ENABLED

#define GCG_DEFAULT_ENABLED   FALSE

Definition at line 53 of file pricingcb.c.

Referenced by doPricingcbCreate().

◆ GCG_DEFAULT_EXCLUSIVE

#define GCG_DEFAULT_EXCLUSIVE   FALSE

Definition at line 54 of file pricingcb.c.

Referenced by doPricingcbCreate().

Function Documentation

◆ doPricingcbCreate()

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 )
static

internal method for creating a pricing callback structure

Parameters
scipSCIP data structure
pricingcbpointer to the pricing callback data structure
namename of the pricing callback
descdescription of the pricing callback
prioritypriority of the the pricing callback
-destructor of the pricing callback
-initialize the pricing callback
-deinitialize the pricing callback
-solving process initialization method of the pricing callback
-solving process deinitialization method of the pricing callback
-pre-pricing method of the pricing callback
-post-pricing method of the pricing callback
pricingcbdatapricing callback data

Definition at line 76 of file pricingcb.c.

References assert(), doPricingcbCreate(), GCG_DECL_PRICINGCBEXIT, GCG_DECL_PRICINGCBEXITSOL, GCG_DECL_PRICINGCBFREE, GCG_DECL_PRICINGCBINIT, GCG_DECL_PRICINGCBINITSOL, GCG_DECL_PRICINGCBPOSTPRICING, GCG_DECL_PRICINGCBPREPRICING, GCG_DEFAULT_ENABLED, GCG_DEFAULT_EXCLUSIVE, and SCIP_CALL().

Referenced by doPricingcbCreate(), and GCGpricingcbCreate().

◆ GCGpricingcbCreate()

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 )

creates a pricing callback

Parameters
gcgGCG data structure
pricingcbpointer to the pricing callback data structure
namename of the pricing callback
descdescription of the pricing callback
prioritypriority of the the pricing callback
-destructor of the pricing callback
-initialize the pricing callback
-deinitialize the pricing callback
-solving process initialization method of the pricing callback
-solving process deinitialization method of the pricing callback
-pre-pricing method of the pricing callback
-post-pricing method of the pricing callback
pricingcbdatapricing callback data

Definition at line 137 of file pricingcb.c.

References assert(), doPricingcbCreate(), GCG_DECL_PRICINGCBEXIT, GCG_DECL_PRICINGCBEXITSOL, GCG_DECL_PRICINGCBFREE, GCG_DECL_PRICINGCBINIT, GCG_DECL_PRICINGCBINITSOL, GCG_DECL_PRICINGCBPOSTPRICING, GCG_DECL_PRICINGCBPREPRICING, GCGgetMasterprob(), GCGpricingcbCreate(), and GCGpricingcbFree().

Referenced by GCGpricerIncludePricingcb(), and GCGpricingcbCreate().

◆ GCGpricingcbFree()

SCIP_RETCODE GCGpricingcbFree ( GCG * gcg,
GCG_PRICINGCB ** pricingcb )

calls destructor and frees memory of the pricing callback

Parameters
gcgGCG data structure
pricingcbpointer to the pricing callback data structure

Definition at line 168 of file pricingcb.c.

References assert(), GCGgetMasterprob(), GCGpricingcbFree(), and SCIP_CALL().

Referenced by GCGpricingcbCreate(), and GCGpricingcbFree().

◆ GCGpricingcbInit()

SCIP_RETCODE GCGpricingcbInit ( GCG * gcg,
GCG_PRICINGCB * pricingcb )

initializes the pricing callback

Parameters
gcgGCG data structure
pricingcbpricing callback

Definition at line 196 of file pricingcb.c.

References assert(), GCGgetMasterprob(), GCGpricingcbInit(), GCG_Pricingcb::npostpricingcalls, GCG_Pricingcb::nprepricingcalls, GCG_Pricingcb::pricingcbclock, SCIP_CALL(), and GCG_Pricingcb::setuptime.

Referenced by GCGpricingcbInit().

◆ GCGpricingcbExit()

SCIP_RETCODE GCGpricingcbExit ( GCG * gcg,
GCG_PRICINGCB * pricingcb )

calls exit method of the pricing callback

Parameters
gcgGCG data structure
pricingcbpricing callback

Definition at line 234 of file pricingcb.c.

References assert(), GCGgetMasterprob(), GCGpricingcbExit(), SCIP_CALL(), and GCG_Pricingcb::setuptime.

Referenced by GCGpricingcbExit().

◆ GCGpricingcbInitsol()

SCIP_RETCODE GCGpricingcbInitsol ( GCG * gcg,
GCG_PRICINGCB * pricingcb )

informs pricing callback that the branch and bound process is being started

informs the pricing callback that the branch and bound process is being started

Parameters
gcgGCG data structure
pricingcbpricing callback

Definition at line 260 of file pricingcb.c.

References assert(), GCGgetMasterprob(), GCGpricingcbInitsol(), SCIP_CALL(), and GCG_Pricingcb::setuptime.

Referenced by GCGpricingcbInitsol().

◆ GCGpricingcbExitsol()

SCIP_RETCODE GCGpricingcbExitsol ( GCG * gcg,
GCG_PRICINGCB * pricingcb )

informs pricing callback that the branch and bound process data is being freed

informs the pricing callback that the branch and bound process data is being freed

Parameters
gcgGCG data structure
pricingcbpricing callback

Definition at line 287 of file pricingcb.c.

References assert(), GCGgetMasterprob(), GCGpricingcbExitsol(), SCIP_CALL(), and GCG_Pricingcb::setuptime.

Referenced by GCGpricingcbExitsol().

◆ GCGpricingcbPrepricing()

SCIP_RETCODE GCGpricingcbPrepricing ( GCG * gcg,
GCG_PRICINGCB * pricingcb,
SCIP_PRICER * pricer,
GCG_PRICETYPE type,
SCIP_Bool * abort,
SCIP_RESULT * result )

calls pre-pricing method of the pricing callback

Parameters
gcgGCG data structure
pricingcbpricing callback
pricerthe pricer
typethe type of pricing, either redcost or farkas
abortshould the pricing be aborted?
resultpointer to store the result of the callback method

Definition at line 314 of file pricingcb.c.

References assert(), GCG_Pricingcb::enabled, GCGgetMasterprob(), GCGpricingcbPrepricing(), GCG_Pricingcb::name, GCG_Pricingcb::nprepricingcalls, GCG_Pricingcb::pricingcbclock, result, and SCIP_CALL().

Referenced by GCGpricingcbPrepricing().

◆ GCGpricingcbPostpricing()

SCIP_RETCODE GCGpricingcbPostpricing ( GCG * gcg,
GCG_PRICINGCB * pricingcb,
SCIP_PRICER * pricer,
GCG_PRICETYPE type,
SCIP_RESULT * result )

calls post-pricing method of the pricing callback

Parameters
gcgGCG data structure
pricingcbpricing callback
pricerthe pricer
typethe type of pricing, either redcost or farkas
resultpointer to store the result of the callback method

Definition at line 363 of file pricingcb.c.

References assert(), GCG_Pricingcb::enabled, GCGgetMasterprob(), GCGpricingcbPostpricing(), GCG_Pricingcb::name, GCG_Pricingcb::npostpricingcalls, GCG_Pricingcb::pricingcbclock, result, and SCIP_CALL().

Referenced by GCGpricingcbPostpricing().

◆ GCGpricingcbSetPriority()

void GCGpricingcbSetPriority ( GCG_PRICINGCB * pricingcb,
int priority )

sets priority of the pricing callback

Parameters
pricingcbpricing callback
prioritynew priority of the pricing callback

Definition at line 433 of file pricingcb.c.

References assert(), GCGpricingcbSetPriority(), and GCG_Pricingcb::priority.

Referenced by GCGpricingcbSetPriority().

◆ GCGpricingcbSetFree()

void GCGpricingcbSetFree ( GCG_PRICINGCB * pricingcb)

sets destructor callback of the pricing callback

Parameters
pricingcbpricing callback destructor of the pricing callback

Definition at line 443 of file pricingcb.c.

References assert(), GCG_DECL_PRICINGCBFREE, and GCGpricingcbSetFree().

Referenced by GCGpricingcbSetFree().

◆ GCGpricingcbSetInit()

void GCGpricingcbSetInit ( GCG_PRICINGCB * pricingcb)

sets initialization callback of the pricing callback

Parameters
pricingcbpricing callback initialize the pricing callback

Definition at line 454 of file pricingcb.c.

References assert(), GCG_DECL_PRICINGCBINIT, and GCGpricingcbSetInit().

Referenced by GCGpricingcbSetInit().

◆ GCGpricingcbSetExit()

void GCGpricingcbSetExit ( GCG_PRICINGCB * pricingcb)

sets deinitialization callback of the pricing callback

Parameters
pricingcbpricing callback deinitialize the pricing callback

Definition at line 465 of file pricingcb.c.

References assert(), GCG_DECL_PRICINGCBEXIT, and GCGpricingcbSetExit().

Referenced by GCGpricingcbSetExit().

◆ GCGpricingcbSetInitsol()

void GCGpricingcbSetInitsol ( GCG_PRICINGCB * pricingcb)

sets solving process initialization callback of the pricing callback

Parameters
pricingcbpricing callback solving process initialization callback of the pricing callback

Definition at line 476 of file pricingcb.c.

References assert(), GCG_DECL_PRICINGCBINITSOL, and GCGpricingcbSetInitsol().

Referenced by GCGpricingcbSetInitsol().

◆ GCGpricingcbSetExitsol()

void GCGpricingcbSetExitsol ( GCG_PRICINGCB * pricingcb)

sets solving process deinitialization callback of pricing callback

sets solving process deinitialization callback of the pricing callback

Parameters
pricingcbpricing callback solving process deinitialization callback of the pricing callback

Definition at line 487 of file pricingcb.c.

References assert(), GCG_DECL_PRICINGCBEXITSOL, and GCGpricingcbSetExitsol().

Referenced by GCGpricingcbSetExitsol().