GOBNILP  f164d83
Macros | Functions
metadata.c File Reference

Contains metadata relating to the problem that is not necessarily part of the LP that will be solved. More...

#include <string.h>
#include "metadata.h"
#include "utils.h"
Include dependency graph for metadata.c:

Macros

#define CONSHDLR_NAME   "metadata"
 The name of this 'constraint handler'. More...
 
#define PARENT_SET_NAME   "parent set data"
 The name of the 'constraint' referring to parent set data. More...
 
#define PEDIGREE_NAME   "pedigree data"
 The name of the 'constraint' referring to pedigree data. More...
 
#define PROPERTY_NAME   "property data"
 The name of the 'constraint' referring to property data. More...
 

Functions

static SCIP_RETCODE createBlankConstraint (SCIP *scip, const char *name)
 Creates a constraint with unusual settings that should mean it is never called. More...
 
static SCIP_RETCODE getConshdlrDataIfExists (SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
 Gets the data associated with the constraint if it has already been set. More...
 
ParentSetDataMD_getParentSetData (SCIP *scip)
 Gets the parent set information associated with the problem. More...
 
PedigreeDataMD_getPedigreeData (SCIP *scip)
 Gets the pedigree information associated with the problem. More...
 
PropertyDataMD_getPropertyData (SCIP *scip)
 Gets the property information associated with the problem. More...
 
SCIP_RETCODE MD_initialiseMetadata (SCIP *scip)
 Initialised the metadata, so that information can be stored in it. More...
 
SCIP_RETCODE MD_setParentSetData (SCIP *scip, ParentSetData *psd)
 Sets the parent set data associated with the problem. More...
 
SCIP_RETCODE MD_setPedigreeData (SCIP *scip, PedigreeData *pd)
 Sets the pedigree data associated with the problem. More...
 
SCIP_RETCODE MD_setPropertyData (SCIP *scip, PropertyData *prop)
 Sets the property data associated with the problem. More...
 
static SCIP_DECL_CONSCHECK (consCheckMetadata)
 Unneeded fundamental callback method, which will always succeed. More...
 
static SCIP_DECL_CONSENFOLP (consEnfolpMetadata)
 Unneeded fundamental callback method, which will always succeed. More...
 
static SCIP_DECL_CONSENFOPS (consEnfopsMetadata)
 Unneeded fundamental callback method, which will always succeed. More...
 
static SCIP_DECL_CONSFREE (consFreeMetadata)
 Frees the metadata held when the program exits. More...
 
static SCIP_DECL_CONSLOCK (consLockMetadata)
 Unneeded fundamental callback method, which will always succeed. More...
 
static SCIP_DECL_CONSPARSE (consParseMetadata)
 Parses the metadata returned from a .cip file and stores it. More...
 
static SCIP_DECL_CONSPRINT (consPrintMetadata)
 Prints the metadata to a .cip file as a fake constraint entry. More...
 

Detailed Description

Contains metadata relating to the problem that is not necessarily part of the LP that will be solved.

At present, the information stored is that of what family sets exist, which variable is associated with each and the names of each node.

This information is stored as a constraint. However, it puts no limitations on the problem and in fact should never be called. The reason for storing this in a constraint is so that the information contained can be written to and read from .cip format files in order to preserve the information needed if the problem is saved in this way.

Macro Definition Documentation

◆ CONSHDLR_NAME

#define CONSHDLR_NAME   "metadata"

◆ PARENT_SET_NAME

#define PARENT_SET_NAME   "parent set data"

The name of the 'constraint' referring to parent set data.

Referenced by MD_setParentSetData(), SCIP_DECL_CONSPARSE(), and SCIP_DECL_CONSPRINT().

◆ PEDIGREE_NAME

#define PEDIGREE_NAME   "pedigree data"

The name of the 'constraint' referring to pedigree data.

Referenced by MD_setPedigreeData(), SCIP_DECL_CONSPARSE(), and SCIP_DECL_CONSPRINT().

◆ PROPERTY_NAME

#define PROPERTY_NAME   "property data"

The name of the 'constraint' referring to property data.

Referenced by MD_setPropertyData(), SCIP_DECL_CONSPARSE(), and SCIP_DECL_CONSPRINT().

Function Documentation

◆ createBlankConstraint()

static SCIP_RETCODE createBlankConstraint ( SCIP *  scip,
const char *  name 
)
static

Creates a constraint with unusual settings that should mean it is never called.

Parameters
scipThe SCIP instance the constaint features in.
nameThe name to give the constraint.
Returns
SCIP_OKAY if the creation succeeds, or an appropriate error code otherwise.

References CONSHDLR_NAME.

Referenced by MD_setParentSetData(), MD_setPedigreeData(), and MD_setPropertyData().

◆ getConshdlrDataIfExists()

static SCIP_RETCODE getConshdlrDataIfExists ( SCIP *  scip,
SCIP_CONSHDLRDATA **  conshdlrdata 
)
static

Gets the data associated with the constraint if it has already been set.

Parameters
scipThe SCIP instance the constraint features in.
conshdlrdataA pointer to return the data.
Returns
SCIP_OKAY if the data could be retrieved, or an appropriate error message otherwise.

References CONSHDLR_NAME.

Referenced by MD_setParentSetData(), MD_setPedigreeData(), and MD_setPropertyData().

◆ MD_getParentSetData()

ParentSetData* MD_getParentSetData ( SCIP *  scip)

Gets the parent set information associated with the problem.

Note that this will return the actual stored data structure, not a copy.

Parameters
scipThe SCIP instance the metadata belongs to.
Returns
The parent set data stored for the problem.

References CONSHDLR_NAME.

Referenced by BN_addMECNonRepetitionConstraint(), BN_addNonRepetitionConstraint(), BN_doIterativePrint(), BN_printcountsols(), BN_printScores(), BN_readProblem(), and SCIP_DECL_HEUREXEC().

◆ MD_getPedigreeData()

PedigreeData* MD_getPedigreeData ( SCIP *  scip)

Gets the pedigree information associated with the problem.

Note that this will return the actual stored data structure, not a copy.

Parameters
scipThe SCIP instance the metadata belongs to.
Returns
The pedigree data stored for the problem.

References CONSHDLR_NAME.

Referenced by assignSexVariables(), PD_addPedigreeSpecificConstraints(), PD_getCurrentPedigreeVarValues(), and PD_printSolutionPedigreeFormat().

◆ MD_getPropertyData()

PropertyData* MD_getPropertyData ( SCIP *  scip)

Gets the property information associated with the problem.

Note that this will return the actual stored data structure, not a copy.

Parameters
scipThe SCIP instance the metadata belongs to.
Returns
The property data stored for the problem.

References CONSHDLR_NAME.

◆ MD_initialiseMetadata()

SCIP_RETCODE MD_initialiseMetadata ( SCIP *  scip)

Initialised the metadata, so that information can be stored in it.

This function must be called before attempting to add data using MD_setParentSetData().

Parameters
scipThe SCIP instance to which the metadata will belong.
Returns
SCIP_OKAY if initialisation succeeded or an appropriate error code otherwise.

References CONSHDLR_NAME.

Referenced by BN_includePlugins().

◆ MD_setParentSetData()

SCIP_RETCODE MD_setParentSetData ( SCIP *  scip,
ParentSetData psd 
)

Sets the parent set data associated with the problem.

This method should only be called once, when the metadata first becomes available for storage. If the information needs changing at a later date, call MD_getParentSetData() and modify the data structure directly.

Parameters
scipThe SCIP instance the metdata relates to.
psdThe parent set data for the problem
Returns
SCIP_OKAY if storage worked, or an appropriate error message otherwise.

References createBlankConstraint(), getConshdlrDataIfExists(), PARENT_SET_NAME, and PS_copyParentSetData().

Referenced by readProblemInNonCIPFormat().

Here is the call graph for this function:

◆ MD_setPedigreeData()

SCIP_RETCODE MD_setPedigreeData ( SCIP *  scip,
PedigreeData pd 
)

Sets the pedigree data associated with the problem.

This method should only be called once, when the metadata first becomes available for storage. If the information needs changing at a later date, call MD_getPedigreeData() and modify the data structure directly.

Parameters
scipThe SCIP instance the metdata relates to.
pdThe pedigree data for the problem
Returns
SCIP_OKAY if storage worked, or an appropriate error message otherwise.

References createBlankConstraint(), getConshdlrDataIfExists(), PE_copyPedigreeData(), and PEDIGREE_NAME.

Referenced by PD_addPedigreeSpecificConstraints().

Here is the call graph for this function:

◆ MD_setPropertyData()

SCIP_RETCODE MD_setPropertyData ( SCIP *  scip,
PropertyData prop 
)

Sets the property data associated with the problem.

This method should only be called once, when the metadata first becomes available for storage. If the information needs changing at a later date, call MD_getPropertyData() and modify the data structure directly.

Parameters
scipThe SCIP instance the metdata relates to.
propThe property data for the problem
Returns
SCIP_OKAY if storage worked, or an appropriate error message otherwise.

References createBlankConstraint(), getConshdlrDataIfExists(), PR_copyPropertyData(), and PROPERTY_NAME.

Referenced by readProblemInNonCIPFormat().

Here is the call graph for this function:

◆ SCIP_DECL_CONSCHECK()

static SCIP_DECL_CONSCHECK ( consCheckMetadata  )
static

Unneeded fundamental callback method, which will always succeed.

◆ SCIP_DECL_CONSENFOLP()

static SCIP_DECL_CONSENFOLP ( consEnfolpMetadata  )
static

Unneeded fundamental callback method, which will always succeed.

◆ SCIP_DECL_CONSENFOPS()

static SCIP_DECL_CONSENFOPS ( consEnfopsMetadata  )
static

Unneeded fundamental callback method, which will always succeed.

◆ SCIP_DECL_CONSFREE()

static SCIP_DECL_CONSFREE ( consFreeMetadata  )
static

Frees the metadata held when the program exits.

References PE_deallocatePedigreeData(), PR_deallocatePropertyData(), and PS_deallocateParentSetData().

Here is the call graph for this function:

◆ SCIP_DECL_CONSLOCK()

static SCIP_DECL_CONSLOCK ( consLockMetadata  )
static

Unneeded fundamental callback method, which will always succeed.

◆ SCIP_DECL_CONSPARSE()

static SCIP_DECL_CONSPARSE ( consParseMetadata  )
static

Parses the metadata returned from a .cip file and stores it.

References PARENT_SET_NAME, PE_parse(), PEDIGREE_NAME, PR_parse(), PROPERTY_NAME, and PS_parse().

Here is the call graph for this function:

◆ SCIP_DECL_CONSPRINT()

static SCIP_DECL_CONSPRINT ( consPrintMetadata  )
static

Prints the metadata to a .cip file as a fake constraint entry.

References PARENT_SET_NAME, PE_writeToFile(), PEDIGREE_NAME, PR_writeToFile(), PROPERTY_NAME, and PS_writeToFile().

Here is the call graph for this function: