GOBNILP  f164d83
Macros | Functions
cons_vanilla.c File Reference

constraint handler for vanilla constraints More...

#include <assert.h>
#include "cons_vanilla.h"
#include "utils.h"
#include <string.h>
#include "parent_set_data.h"
Include dependency graph for cons_vanilla.c:

Macros

#define CONSHDLR_CHECKPRIORITY   0
 priority of the constraint handler for checking feasibility
 
#define CONSHDLR_DELAYPROP   FALSE
 should propagation method be delayed, if other propagators found reductions?
 
#define CONSHDLR_DELAYSEPA   FALSE
 should separation method be delayed, if other separators found cuts?
 
#define CONSHDLR_DESC   "constraint handler template"
 
#define CONSHDLR_EAGERFREQ   100
 frequency for using all instead of only the useful constraints in separation, propagation and enforcement, -1 for no eager evaluations, 0 for first only
 
#define CONSHDLR_ENFOPRIORITY   0
 priority of the constraint handler for constraint enforcing
 
#define CONSHDLR_MAXPREROUNDS   -1
 maximal number of presolving rounds the constraint handler participates in (-1: no limit)
 
#define CONSHDLR_NAME   "vanilla"
 
#define CONSHDLR_NEEDSCONS   TRUE
 should the constraint handler be skipped, if no constraints are available?
 
#define CONSHDLR_PRESOLTIMING   SCIP_PRESOLTIMING_MEDIUM
 presolving timing of the constraint handler (fast, medium, or exhaustive)
 
#define CONSHDLR_PROP_TIMING   SCIP_PROPTIMING_BEFORELP
 propagation timing mask of the constraint handler
 
#define CONSHDLR_PROPFREQ   1
 frequency for propagating domains; zero means only preprocessing propagation
 
#define CONSHDLR_SEPAFREQ   -1
 frequency for separating cuts; zero means to separate only in the root node
 
#define CONSHDLR_SEPAPRIORITY   0
 priority of the constraint handler for separation
 

Functions

static SCIP_Bool arrow_preferred (ParentSetData *psd, SCIP_Bool ***store, int child, int parent)
 Returns true if adding parent to any parent set for child increases the score. More...
 
static SCIP_RETCODE createConsData (SCIP *scip, SCIP_CONSDATA **consdata, ParentSetData *psd, SCIP_VAR ***ancestorvars)
 Creates the data for a constraint. More...
 
static SCIP_DECL_CONSCHECK (consCheckVanilla)
 feasibility check method of constraint handler for integral solutions
 
static SCIP_DECL_CONSDELETE (consDeleteVanilla)
 frees specific constraint data
 
static SCIP_DECL_CONSENFOLP (consEnfolpVanilla)
 constraint enforcing method of constraint handler for LP solutions
 
static SCIP_DECL_CONSENFOPS (consEnfopsVanilla)
 constraint enforcing method of constraint handler for pseudo solutions
 
static SCIP_DECL_CONSINITLP (consInitlpVanilla)
 LP initialization method of constraint handler (called before the initial LP relaxation at a node is solved)
 
static SCIP_DECL_CONSLOCK (consLockVanilla)
 variable rounding lock method of constraint handler
 
static SCIP_DECL_CONSPRESOL (consPresolVanilla)
 presolving method of constraint handler
 
static SCIP_DECL_CONSPROP (consPropVanilla)
 domain propagation method of constraint handler
 
SCIP_RETCODE SCIPcreateConsBasicVanilla (SCIP *scip, SCIP_CONS **cons, const char *name, ParentSetData *psd, SCIP_VAR ***ancestorvars)
 creates and captures a vanilla constraint with all its constraint flags set to their default values More...
 
SCIP_RETCODE SCIPcreateConsVanilla (SCIP *scip, SCIP_CONS **cons, const char *name, ParentSetData *psd, SCIP_VAR ***ancestorvars, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
 creates and captures a vanilla constraint More...
 
SCIP_RETCODE SCIPincludeConshdlrVanilla (SCIP *scip)
 creates the handler for vanilla constraints and includes it in SCIP More...
 

Detailed Description

constraint handler for vanilla constraints

Author
James Cussens

Function Documentation

◆ arrow_preferred()

static SCIP_Bool arrow_preferred ( ParentSetData psd,
SCIP_Bool ***  store,
int  child,
int  parent 
)
static

Returns true if adding parent to any parent set for child increases the score.

Parameters
psdparent sets data structure
childchild BN variable
parentparent BN variable

References createConsData(), ParentSetData::nParents, ParentSetData::nParentSets, and ParentSetData::ParentSets.

Here is the call graph for this function:

◆ createConsData()

static SCIP_RETCODE createConsData ( SCIP *  scip,
SCIP_CONSDATA **  consdata,
ParentSetData psd,
SCIP_VAR ***  ancestorvars 
)
static

Creates the data for a constraint.

Parameters
scipThe SCIP instance to which the constraaint belongs.
consdataThe location to store the new constraint data.
psdThe parent set data on which the constraint is based.
Returns
SCIP_OKAY if successful, or an appropriate error otherwise.

References ParentSetData::n, ParentSetData::nParents, ParentSetData::nParentSets, ParentSetData::ParentSets, PS_copyParentSetData(), and SCIP_DECL_CONSDELETE().

Referenced by arrow_preferred().

Here is the call graph for this function:

◆ SCIPcreateConsBasicVanilla()

SCIP_RETCODE SCIPcreateConsBasicVanilla ( SCIP *  scip,
SCIP_CONS **  cons,
const char *  name,
ParentSetData psd,
SCIP_VAR ***  ancestorvars 
)

creates and captures a vanilla constraint with all its constraint flags set to their default values

Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
psdparent set data
ancestorvarsancestor vars (or NULL if not used )

References SCIPcreateConsVanilla().

Here is the call graph for this function:

◆ SCIPcreateConsVanilla()

SCIP_RETCODE SCIPcreateConsVanilla ( SCIP *  scip,
SCIP_CONS **  cons,
const char *  name,
ParentSetData psd,
SCIP_VAR ***  ancestorvars,
SCIP_Bool  initial,
SCIP_Bool  separate,
SCIP_Bool  enforce,
SCIP_Bool  check,
SCIP_Bool  propagate,
SCIP_Bool  local,
SCIP_Bool  modifiable,
SCIP_Bool  dynamic,
SCIP_Bool  removable,
SCIP_Bool  stickingatnode 
)

creates and captures a vanilla constraint

Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
psdparent set data
ancestorvarsancestor vars (or NULL if not used )
initialshould the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'.
separateshould the constraint be separated during LP processing? Usually set to TRUE.
enforceshould the constraint be enforced during node processing? TRUE for model constraints, FALSE for additional, redundant constraints.
checkshould the constraint be checked for feasibility? TRUE for model constraints, FALSE for additional, redundant constraints.
propagateshould the constraint be propagated during node processing? Usually set to TRUE.
localis constraint only valid locally? Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints.
modifiableis constraint modifiable (subject to column generation)? Usually set to FALSE. In column generation applications, set to TRUE if pricing adds coefficients to this constraint.
dynamicis constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are separated as constraints.
removableshould the relaxation be removed from the LP due to aging or cleanup? Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'.
stickingatnodeshould the constraint always be kept at the node where it was added, even if it may be moved to a more global node? Usually set to FALSE. Set to TRUE to for constraints that represent node data.

Referenced by addAdditionalConstraints(), and SCIPcreateConsBasicVanilla().

◆ SCIPincludeConshdlrVanilla()

SCIP_RETCODE SCIPincludeConshdlrVanilla ( SCIP *  scip)

creates the handler for vanilla constraints and includes it in SCIP

Parameters
scipSCIP data structure

Referenced by addAdditionalConstraints().