GOBNILP  f164d83
Functions
property_data.c File Reference

Contains functions related to managing PropertyData. More...

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

Functions

SCIP_RETCODE PR_copyPropertyData (SCIP *scip, PropertyData *original, PropertyData **duplicate)
 Makes a deep copy of a PropertyData structure. More...
 
SCIP_RETCODE PR_deallocatePropertyData (SCIP *scip, PropertyData **pd)
 Deallocates the memory associated with a PropertyData structure. More...
 
char * PR_getGlobalProperty (SCIP *scip, PropertyData *pd, const char *name)
 Get the value of a global property. More...
 
char * PR_getProperty (SCIP *scip, PropertyData *pd, int individual, const char *name)
 Returns the value of a given property for a given individual. More...
 
SCIP_Bool PR_hasGlobalProperty (SCIP *scip, PropertyData *pd, const char *name)
 Find out whether a string is a global property. More...
 
SCIP_Bool PR_hasProperty (SCIP *scip, PropertyData *pd, int individual, const char *name)
 Does a property data structure have a given property for a given individual? More...
 
void PR_initialise (PropertyData *pd)
 Initialises a data structure with empty values. More...
 
SCIP_RETCODE PR_parse (SCIP *scip, char *str, PropertyData **pd)
 Parses a PropertyData structure from a sting. More...
 
SCIP_RETCODE PR_setGlobalProperty (SCIP *scip, PropertyData *pd, const char *name, const char *value)
 Set a global property to a given value. More...
 
SCIP_RETCODE PR_setGlobalPropertyFromArray (SCIP *scip, PropertyData *pd, const char *name, const char **value, int length)
 Set a global property to a given value Value is converted from an array of strings to a string. More...
 
SCIP_RETCODE PR_setGlobalPropertyFromBool (SCIP *scip, PropertyData *pd, const char *name, SCIP_Bool value)
 Set a global property to a given value Value is converted from a SCIP_Bool to a string. More...
 
SCIP_RETCODE PR_setGlobalPropertyFromInt (SCIP *scip, PropertyData *pd, const char *name, int value)
 Set a global property to a given value. More...
 
SCIP_RETCODE PR_setGlobalPropertyFromReal (SCIP *scip, PropertyData *pd, const char *name, SCIP_Real value)
 Set a global property to a given value Value is converted from a SCIP_Real to a string. More...
 
SCIP_RETCODE PR_setGlobalPropertyFromRealArray (SCIP *scip, PropertyData *pd, const char *name, SCIP_Real *value, int length)
 Set a global property to a given value Value is converted from an array of reals to a string. More...
 
SCIP_RETCODE PR_setProperty (SCIP *scip, PropertyData *pd, int individual, const char *name, const char *value)
 Set a property for an individual to a given value. More...
 
SCIP_RETCODE PR_setPropertyFromArray (SCIP *scip, PropertyData *pd, int individual, const char *name, const char **value, int length)
 Set a property for an individual to a given value Value is converted from an array of strings to a string. More...
 
SCIP_RETCODE PR_setPropertyFromBool (SCIP *scip, PropertyData *pd, int individual, const char *name, SCIP_Bool value)
 Set a property for an individual to a given value Value is converted from a SCIP_Bool to a string. More...
 
SCIP_RETCODE PR_setPropertyFromInt (SCIP *scip, PropertyData *pd, int individual, const char *name, int value)
 Set a property for an individual to a given value Value is converted from an int to a string. More...
 
SCIP_RETCODE PR_setPropertyFromReal (SCIP *scip, PropertyData *pd, int individual, const char *name, SCIP_Real value)
 Set a property for an individual to a given value Value is converted from a SCIP_Real to a string. More...
 
SCIP_RETCODE PR_setPropertyFromRealArray (SCIP *scip, PropertyData *pd, int individual, const char *name, SCIP_Real *value, int length)
 Set a property for an individual to a given value Value is converted from an array of reals to a string. More...
 
SCIP_RETCODE PR_writeToFile (SCIP *scip, FILE *file, PropertyData *pd)
 Writes a PropertyData structure to file. More...
 

Detailed Description

Contains functions related to managing PropertyData.

Function Documentation

◆ PR_copyPropertyData()

SCIP_RETCODE PR_copyPropertyData ( SCIP *  scip,
PropertyData original,
PropertyData **  duplicate 
)

Makes a deep copy of a PropertyData structure.

Parameters
scipThe SCIP instance to which the data belongs.
originalThe original data structure.
duplicateA pointer to the duplicated data structure.
Returns
SCIP_OKAY if copying suceeded.

References PropertyData::global_property_names, PropertyData::global_property_values, PropertyData::n, PropertyData::num_global, PropertyData::num_properties, PropertyData::property_names, and PropertyData::property_values.

Referenced by MD_setPropertyData().

◆ PR_deallocatePropertyData()

SCIP_RETCODE PR_deallocatePropertyData ( SCIP *  scip,
PropertyData **  pd 
)

Deallocates the memory associated with a PropertyData structure.

Parameters
scipThe SCIP instance which the data refers to.
pdA pointer to the data structure to deallocate.
Returns
SCIP_OKAY if the allocation succeeded.

Referenced by readProblemInNonCIPFormat(), and SCIP_DECL_CONSFREE().

◆ PR_getGlobalProperty()

char* PR_getGlobalProperty ( SCIP *  scip,
PropertyData pd,
const char *  name 
)

Get the value of a global property.

Returns
If the global property exists then its value else NULL
Parameters
scipSCIP data structure (not used)
pdProperty data structure
nameGlobal property whose value is sought

References PropertyData::global_property_names, PropertyData::global_property_values, and PropertyData::num_global.

◆ PR_getProperty()

char* PR_getProperty ( SCIP *  scip,
PropertyData pd,
int  individual,
const char *  name 
)

Returns the value of a given property for a given individual.

Returns
The value of the property for the individual or NULL if missing
Parameters
scipSCIP data structure
pdProperty data structure
individualIndividual
nameProperty name

References PropertyData::num_properties, PropertyData::property_names, and PropertyData::property_values.

◆ PR_hasGlobalProperty()

SCIP_Bool PR_hasGlobalProperty ( SCIP *  scip,
PropertyData pd,
const char *  name 
)

Find out whether a string is a global property.

Returns
TRUE if the string is a global property, else FALSE
Parameters
scipSCIP data structure (not used)
pdProperty data structure
nameString to be queried

References PropertyData::global_property_names, and PropertyData::num_global.

◆ PR_hasProperty()

SCIP_Bool PR_hasProperty ( SCIP *  scip,
PropertyData pd,
int  individual,
const char *  name 
)

Does a property data structure have a given property for a given individual?

Returns
TRUE if it does, FALSE otherwise
Parameters
scipSCIP data structure
pdProperty data structure
individualIndividual
nameProperty name

References PropertyData::num_properties, and PropertyData::property_names.

◆ PR_initialise()

void PR_initialise ( PropertyData pd)

◆ PR_parse()

SCIP_RETCODE PR_parse ( SCIP *  scip,
char *  str,
PropertyData **  pd 
)

Parses a PropertyData structure from a sting.

Parameters
scipThe SCIP instance the data will belong to.
strThe string to parse.
pdA pointer to the data structure resulting from parsing.
Returns
SCIP_OKAY if parsing succeeded.

References UT_parseArray(), and UT_parseStringArray().

Referenced by SCIP_DECL_CONSPARSE().

Here is the call graph for this function:

◆ PR_setGlobalProperty()

SCIP_RETCODE PR_setGlobalProperty ( SCIP *  scip,
PropertyData pd,
const char *  name,
const char *  value 
)

Set a global property to a given value.

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
nameGlobal property to be set
valueValue of global property

References PropertyData::global_property_names, PropertyData::global_property_values, and PropertyData::num_global.

Referenced by PR_setGlobalPropertyFromArray(), PR_setGlobalPropertyFromBool(), PR_setGlobalPropertyFromInt(), PR_setGlobalPropertyFromReal(), and PR_setGlobalPropertyFromRealArray().

◆ PR_setGlobalPropertyFromArray()

SCIP_RETCODE PR_setGlobalPropertyFromArray ( SCIP *  scip,
PropertyData pd,
const char *  name,
const char **  value,
int  length 
)

Set a global property to a given value Value is converted from an array of strings to a string.

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
nameGlobal property to be set
valueValue for the global property
lengthLength of the array

References PR_setGlobalProperty().

Here is the call graph for this function:

◆ PR_setGlobalPropertyFromBool()

SCIP_RETCODE PR_setGlobalPropertyFromBool ( SCIP *  scip,
PropertyData pd,
const char *  name,
SCIP_Bool  value 
)

Set a global property to a given value Value is converted from a SCIP_Bool to a string.

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
nameGlobal property to be set
valueValue for the global property

References PR_setGlobalProperty().

Here is the call graph for this function:

◆ PR_setGlobalPropertyFromInt()

SCIP_RETCODE PR_setGlobalPropertyFromInt ( SCIP *  scip,
PropertyData pd,
const char *  name,
int  value 
)

Set a global property to a given value.

Value is converted from an int to a string

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
nameGlobal property to be set
valueValue for the global property

References PR_setGlobalProperty().

Here is the call graph for this function:

◆ PR_setGlobalPropertyFromReal()

SCIP_RETCODE PR_setGlobalPropertyFromReal ( SCIP *  scip,
PropertyData pd,
const char *  name,
SCIP_Real  value 
)

Set a global property to a given value Value is converted from a SCIP_Real to a string.

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
nameGlobal property to be set
valueValue for the global property

References PR_setGlobalProperty().

Here is the call graph for this function:

◆ PR_setGlobalPropertyFromRealArray()

SCIP_RETCODE PR_setGlobalPropertyFromRealArray ( SCIP *  scip,
PropertyData pd,
const char *  name,
SCIP_Real *  value,
int  length 
)

Set a global property to a given value Value is converted from an array of reals to a string.

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
nameGlobal property to be set
valueValue for the global property
lengthLength of the array

References PR_setGlobalProperty().

Here is the call graph for this function:

◆ PR_setProperty()

SCIP_RETCODE PR_setProperty ( SCIP *  scip,
PropertyData pd,
int  individual,
const char *  name,
const char *  value 
)

Set a property for an individual to a given value.

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
individualIndividual
nameProperty name
valueProperty value

References PropertyData::n, PropertyData::num_properties, PropertyData::property_names, and PropertyData::property_values.

Referenced by PR_setPropertyFromArray(), PR_setPropertyFromBool(), PR_setPropertyFromInt(), PR_setPropertyFromReal(), and PR_setPropertyFromRealArray().

◆ PR_setPropertyFromArray()

SCIP_RETCODE PR_setPropertyFromArray ( SCIP *  scip,
PropertyData pd,
int  individual,
const char *  name,
const char **  value,
int  length 
)

Set a property for an individual to a given value Value is converted from an array of strings to a string.

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
individualIndividual
nameProperty name
valueProperty value
lengthLength of the array

References PR_setProperty().

Here is the call graph for this function:

◆ PR_setPropertyFromBool()

SCIP_RETCODE PR_setPropertyFromBool ( SCIP *  scip,
PropertyData pd,
int  individual,
const char *  name,
SCIP_Bool  value 
)

Set a property for an individual to a given value Value is converted from a SCIP_Bool to a string.

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
individualIndividual
nameProperty name
valueProperty value

References PR_setProperty().

Here is the call graph for this function:

◆ PR_setPropertyFromInt()

SCIP_RETCODE PR_setPropertyFromInt ( SCIP *  scip,
PropertyData pd,
int  individual,
const char *  name,
int  value 
)

Set a property for an individual to a given value Value is converted from an int to a string.

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
individualIndividual
nameProperty name
valueProperty value

References PR_setProperty().

Here is the call graph for this function:

◆ PR_setPropertyFromReal()

SCIP_RETCODE PR_setPropertyFromReal ( SCIP *  scip,
PropertyData pd,
int  individual,
const char *  name,
SCIP_Real  value 
)

Set a property for an individual to a given value Value is converted from a SCIP_Real to a string.

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
individualIndividual
nameProperty name
valueProperty value

References PR_setProperty().

Here is the call graph for this function:

◆ PR_setPropertyFromRealArray()

SCIP_RETCODE PR_setPropertyFromRealArray ( SCIP *  scip,
PropertyData pd,
int  individual,
const char *  name,
SCIP_Real *  value,
int  length 
)

Set a property for an individual to a given value Value is converted from an array of reals to a string.

Returns
SCIP_OKAY if all is well
Parameters
scipSCIP data structure
pdProperty data structure
individualIndividual
nameProperty name
valueProperty value
lengthLength of the array

References PR_setProperty().

Here is the call graph for this function:

◆ PR_writeToFile()

SCIP_RETCODE PR_writeToFile ( SCIP *  scip,
FILE *  file,
PropertyData pd 
)

Writes a PropertyData structure to file.

Parameters
scipThe SCIP instance the data belongs to.
fileThe file to write to.
pdThe data to write.
Returns
SCIP_OKAY if the writing succeeded.

Referenced by SCIP_DECL_CONSPRINT().