Scippy

SCIP

Solving Constraint Integer Programs

vardata_binpacking.c File Reference

Detailed Description

Variable data containing the ids of constraints in which the variable appears.

Author
Timo Berthold
Stefan Heinz

This file implements the handling of the variable data which is attached to each file. See SCIP_VarData and Pricing new variables.

Definition in file vardata_binpacking.c.

Go to the source code of this file.

Functions

Local methods
static SCIP_RETCODE vardataCreate (SCIP *scip, SCIP_VARDATA **vardata, int *consids, int nconsids)
 
static SCIP_RETCODE vardataDelete (SCIP *scip, SCIP_VARDATA **vardata)
 
Callback methods
static SCIP_DECL_VARDELTRANS (vardataDelTrans)
 
Interface methods
SCIP_RETCODE SCIPvardataCreateBinpacking (SCIP *scip, SCIP_VARDATA **vardata, int *consids, int nconsids)
 
int SCIPvardataGetNConsids (SCIP_VARDATA *vardata)
 
int * SCIPvardataGetConsids (SCIP_VARDATA *vardata)
 
SCIP_RETCODE SCIPcreateVarBinpacking (SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real obj, SCIP_Bool initial, SCIP_Bool removable, SCIP_VARDATA *vardata)
 
void SCIPvardataPrint (SCIP *scip, SCIP_VARDATA *vardata, FILE *file)
 

Function Documentation

◆ vardataCreate()

static SCIP_RETCODE vardataCreate ( SCIP scip,
SCIP_VARDATA **  vardata,
int *  consids,
int  nconsids 
)
static

create a vardata

Parameters
scipSCIP data structure
vardatapointer to vardata
considsarray of constraints ids
nconsidsnumber of constraints

Definition at line 47 of file vardata_binpacking.c.

References SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory(), SCIPduplicateBlockMemoryArray, and SCIPsortInt().

Referenced by SCIPvardataCreateBinpacking().

◆ vardataDelete()

static SCIP_RETCODE vardataDelete ( SCIP scip,
SCIP_VARDATA **  vardata 
)
static

frees user data of variable

Parameters
scipSCIP data structure
vardatavardata to delete

Definition at line 66 of file vardata_binpacking.c.

References SCIP_OKAY, SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArray.

Referenced by SCIP_DECL_VARDELTRANS().

◆ SCIP_DECL_VARDELTRANS()

static SCIP_DECL_VARDELTRANS ( vardataDelTrans  )
static

frees user data of transformed variable (called when the transformed variable is freed)

Definition at line 87 of file vardata_binpacking.c.

References SCIP_CALL, SCIP_OKAY, and vardataDelete().

◆ SCIPvardataCreateBinpacking()

SCIP_RETCODE SCIPvardataCreateBinpacking ( SCIP scip,
SCIP_VARDATA **  vardata,
int *  consids,
int  nconsids 
)

create variable data

Parameters
scipSCIP data structure
vardatapointer to vardata
considsarray of constraints ids
nconsidsnumber of constraints

Definition at line 103 of file vardata_binpacking.c.

References SCIP_CALL, SCIP_OKAY, and vardataCreate().

Referenced by createInitialColumns(), and SCIP_DECL_PRICERREDCOST().

◆ SCIPvardataGetNConsids()

int SCIPvardataGetNConsids ( SCIP_VARDATA vardata)

get number of constraints

Parameters
vardatavariable data

Definition at line 116 of file vardata_binpacking.c.

Referenced by addFixedVarsConss(), checkVariable(), consdataCheck(), and SCIP_DECL_BRANCHEXECLP().

◆ SCIPvardataGetConsids()

int* SCIPvardataGetConsids ( SCIP_VARDATA vardata)

returns sorted constraint id array

Parameters
vardatavariable data

Definition at line 124 of file vardata_binpacking.c.

Referenced by addFixedVarsConss(), checkVariable(), consdataCheck(), and SCIP_DECL_BRANCHEXECLP().

◆ SCIPcreateVarBinpacking()

SCIP_RETCODE SCIPcreateVarBinpacking ( SCIP scip,
SCIP_VAR **  var,
const char *  name,
SCIP_Real  obj,
SCIP_Bool  initial,
SCIP_Bool  removable,
SCIP_VARDATA vardata 
)

creates variable

Parameters
scipSCIP data structure
varpointer to variable object
namename of variable, or NULL for automatic name creation
objobjective function value
initialshould var's column be present in the initial root LP?
removableis var's column removable from the LP (due to aging or cleanup)?
vardatauser data for this specific variable

Definition at line 142 of file vardata_binpacking.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIP_VARTYPE_BINARY, SCIPcreateVarBasic(), SCIPdebug, SCIPprintVar(), SCIPvarMarkDeletable(), SCIPvarSetData(), SCIPvarSetDeltransData(), SCIPvarSetInitial(), and SCIPvarSetRemovable().

Referenced by createInitialColumns(), and SCIP_DECL_PRICERREDCOST().

◆ SCIPvardataPrint()

void SCIPvardataPrint ( SCIP scip,
SCIP_VARDATA vardata,
FILE *  file 
)

prints vardata to file stream

Parameters
scipSCIP data structure
vardatavariable data
filethe text file to store the information into

Definition at line 175 of file vardata_binpacking.c.

References NULL, SCIPgetProbData(), SCIPinfoMessage(), and SCIPprobdataGetIds().

Referenced by consdataCheck().