GOBNILP  f164d83
Macros | Functions
utils.c File Reference

Contains some useful functions that may be needed in several other files. More...

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

Macros

#define BUCKET_BLOCK_LENGTH   1
 
#define ESC_CHAR   '\\'
 The character used to escape special characters when writing to a file. More...
 
#define SPARSE_MATRIX_SIZE   20
 

Functions

SCIP_RETCODE allsubsets (SCIP *scip, const int *set, const int n, int ***subsets_ptr)
 
static int convertToSimpleForm (char *line, char *splitters, int num_splitters, SCIP_Bool multiple_splitters_as_one, char **output_line)
 
static int countNumberOfSegments (char *line, int length, char splitter)
 
static SCIP_RETCODE escapeString (char *input_string, char **output_string)
 Adds an necessary escape characters to a string so it will be re-read correctly. More...
 
SCIP_RETCODE free_allsubsets (SCIP *scip, int ***subsets_ptr)
 
SCIP_VAR * get_arrow (const ParentSetData *psd, const int i, const int j)
 Retrieve an arrow variable for specified child and parent or NULL if none exists. More...
 
SCIP_VAR * get_arrowedge (const ParentSetData *psd, int i, int j, SCIP_Bool arrow)
 Retrieve an arrow or edge variable for specified child and parent or NULL if none exists. More...
 
SCIP_VAR * get_edge (const ParentSetData *psd, const int i, const int j)
 Retrieve an edge variable for specified child and parent or NULL if none exists. More...
 
int get_index (char *nodeName, ParentSetData *psd)
 Gets the index of a named variable. More...
 
SCIP_RETCODE hashtableCreateArrow (SCIP *scip, ParentSetData *psd)
 Creates a hash table. More...
 
SCIP_RETCODE hashtablefreeArrow (SCIP *scip, ParentSetData *psd)
 Frees memory (previously) used by a hash table. More...
 
SCIP_Bool is_dr_feasible (SCIP *scip, const ParentSetData *psd, SCIP_SOL *sol, SCIP_Bool constructing, SCIP_SOL *dr_sol)
 
static SCIP_Bool isSplitter (char item, char *splitters, int num_splitters)
 
static SCIP_Bool needsEscaping (char item)
 Whether a character needs an escape character adding before it can be written to fiel. More...
 
SCIP_RETCODE put_arrow (SCIP *scip, ParentSetData *psd, const int i, const int j, SCIP_VAR *arrow_i_j)
 Store an arrow variable for specified child and parent. More...
 
static SCIP_RETCODE put_arrowedge (SCIP *scip, ParentSetData *psd, int i, int j, SCIP_VAR *arrow_i_j, SCIP_Bool arrow)
 Store an arrow or edge variable for specified child and parent. More...
 
SCIP_RETCODE put_edge (SCIP *scip, ParentSetData *psd, const int i, const int j, SCIP_VAR *arrow_i_j)
 Store an edge variable for specified child and parent. More...
 
static SCIP_RETCODE readNextLine (SCIP *scip, FILE *file, int *length, char **buffer, char **status)
 
char * SCIPstrdup (SCIP *scip, const char *str)
 
static SCIP_RETCODE unescapeString (char *input_string, char **output_string)
 Removes an escape charcters from a string to return the string before it was escaped. More...
 
SCIP_RETCODE UT_addBoolParam (SCIP *scip, const char *name, const char *desc, SCIP_Bool value)
 Adds a boolean parameter to those recognised by SCIP. More...
 
SCIP_RETCODE UT_addIntParam (SCIP *scip, const char *name, const char *desc, int value, int min, int max)
 Adds an integer parameter to those recognised by SCIP. More...
 
SCIP_RETCODE UT_addLongintParam (SCIP *scip, const char *name, const char *desc, SCIP_Longint value, SCIP_Longint min, SCIP_Longint max)
 Adds a long integer parameter to those recognised by SCIP. More...
 
SCIP_RETCODE UT_addRealParam (SCIP *scip, const char *name, const char *desc, SCIP_Real value, SCIP_Real min, SCIP_Real max)
 Adds a real valued parameter to those recognised by SCIP. More...
 
SCIP_RETCODE UT_addStringParam (SCIP *scip, const char *name, const char *desc, const char *value)
 Adds a string parameter to those recognised by SCIP. More...
 
SCIP_RETCODE UT_createEmptyGTEConstraint (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_Real lhs)
 Creates an initially empty greater than or equal to linear constraint with most options set to sensible defaults. More...
 
SCIP_RETCODE UT_createEmptyLinearConstraint (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_Real lhs, SCIP_Real rhs)
 Creates an initially empty linear constraint with most options set to sensible defaults. More...
 
SCIP_RETCODE UT_createEmptyLTEConstraint (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_Real rhs)
 Creates an initially empty less than or equal to linear constraint with most options set to sensible defaults. More...
 
SCIP_RETCODE UT_parseArray (char *input_string, char ***output_array)
 Parses an array from a string. More...
 
SCIP_RETCODE UT_parseCharArray (char *input_string, char **output_array, int length)
 Parses a character array from a string. More...
 
SCIP_RETCODE UT_parseIntArray (char *input_string, int **output_array, int length)
 Parses an integer array from a string. More...
 
SCIP_RETCODE UT_parseIntArrayArray (char *input_string, int ***output_array, int *lengths, int length)
 Parses an array of integer arrays from a string. More...
 
SCIP_RETCODE UT_parseIntArrayArrayArray (char *input_string, int ****output_array, int **lengths, int *lengths_of_lengths, int length)
 Parses an array of arrays of integer arrays from a string. More...
 
SCIP_RETCODE UT_parseStringArray (char *input_string, char ***output_array, int length)
 Parses a string array from a string. More...
 
SCIP_RETCODE UT_parseVarArray (SCIP *scip, char *input_string, SCIP_VAR ***output_array, int length)
 Parses a variable array from a string. More...
 
SCIP_RETCODE UT_parseVarArrayArray (SCIP *scip, char *input_string, SCIP_VAR ****output_array, int *lengths, int length)
 Parses an array of variable arrays from a string. More...
 
SCIP_RETCODE UT_readFileAndSplit (SCIP *scip, FILE *file, char *splitters, int num_splitters, SCIP_Bool multiple_splitters_as_one, char ****lines, int *num_lines, int **line_lengths)
 Reads a file and splits it into lines, which are themselves split into white space delimited tokens. More...
 
SCIP_RETCODE UT_writeCharArray (SCIP *scip, FILE *file, char *input_array, int length)
 Writes an array of characters to a file. More...
 
SCIP_RETCODE UT_writeIntArray (SCIP *scip, FILE *file, int *input_array, int length)
 Writes an array of integers to a file. More...
 
SCIP_RETCODE UT_writeIntArrayArray (SCIP *scip, FILE *file, int **input_array, int *lengths, int length)
 Writes an array of arrays of integers to a file. More...
 
SCIP_RETCODE UT_writeIntArrayArrayArray (SCIP *scip, FILE *file, int ***input_array, int **lengths, int *lengths_of_lengths, int length)
 Writes an array of arrays of arrays of integers to a file. More...
 
SCIP_RETCODE UT_writeStringArray (SCIP *scip, FILE *file, char **input_array, int length)
 Writes an array of strings to a file. More...
 
SCIP_RETCODE UT_writeVarArray (SCIP *scip, FILE *file, SCIP_VAR **input_array, int length)
 Writes the names of an array of variables to a file. More...
 
SCIP_RETCODE UT_writeVarArrayArray (SCIP *scip, FILE *file, SCIP_VAR ***input_array, int *lengths, int length)
 Writes an array of arrays of variables to a file. More...
 

Detailed Description

Contains some useful functions that may be needed in several other files.

Currently, there are four sorts of function included in this file.

Macro Definition Documentation

◆ ESC_CHAR

#define ESC_CHAR   '\\'

The character used to escape special characters when writing to a file.

Referenced by escapeString(), and unescapeString().

Function Documentation

◆ allsubsets()

SCIP_RETCODE allsubsets ( SCIP *  scip,
const int *  set,
const int  n,
int ***  subsets_ptr 
)
Parameters
scipSCIP instance
setset whose subsets we want
nnumber of elements in set
subsets_ptr(pointer to ) output subsets[0][0] is the number of subsets subsets[j][0] is the size of the jth subset subsets[j][i] is the ith element of the jth subset

References allsubsets().

Referenced by allsubsets(), and makeimsetvars().

Here is the call graph for this function:

◆ escapeString()

static SCIP_RETCODE escapeString ( char *  input_string,
char **  output_string 
)
static

Adds an necessary escape characters to a string so it will be re-read correctly.

Parameters
input_stringThe initial string.
output_stringA copy of the string after any escape characters have been added.
Returns
SCIP_OKAY if the operation succeeded.

References ESC_CHAR, and needsEscaping().

Here is the call graph for this function:

◆ free_allsubsets()

SCIP_RETCODE free_allsubsets ( SCIP *  scip,
int ***  subsets_ptr 
)
Parameters
scipSCIP instance
subsets_ptrdata to free

Referenced by makeimsetvars().

◆ get_arrow()

SCIP_VAR* get_arrow ( const ParentSetData psd,
const int  i,
const int  j 
)

Retrieve an arrow variable for specified child and parent or NULL if none exists.

Returns
an arrow variable for specified child and parent or NULL if none exists
Parameters
psdthe parent sets data structure
ichild variable
jparent variable

References get_arrowedge().

Referenced by addArrowVariables(), addNChildrenVars(), addOrderedCoveredArcConstraints(), addParentNumberConstraints(), addPosindVariables(), addPosVariables(), addTotalorderVariables(), edge_constraint(), is_dr_feasible(), isFeasible_arrows(), PS_copyParentSetData(), PS_deallocateParentSetData(), PS_specialiseFor(), SCIP_DECL_CONSLOCK(), SCIP_DECL_CONSPROP(), setBranchingPriorities(), and setSpecialProperties().

Here is the call graph for this function:

◆ get_arrowedge()

SCIP_VAR* get_arrowedge ( const ParentSetData psd,
int  i,
int  j,
SCIP_Bool  arrow 
)

Retrieve an arrow or edge variable for specified child and parent or NULL if none exists.

Returns
an arrow or edge variable for specified child and parent or NULL if none exists
Parameters
psdthe parent sets data structure
ichild variable
jparent variable
arrowIf TRUE return arrow variable for i and j, else return edge variable for i and j

References ParentSetData::arrow, and ParentSetData::edge.

Referenced by get_arrow(), get_edge(), is_dr_feasible(), and SCIP_DECL_HEUREXEC().

◆ get_edge()

SCIP_VAR* get_edge ( const ParentSetData psd,
const int  i,
const int  j 
)

Retrieve an edge variable for specified child and parent or NULL if none exists.

Returns
an edge variable for specified child and parent or NULL if none exists
Parameters
psdthe parent sets data structure
ichild variable
jparent variable

References get_arrowedge().

Referenced by addEdgeNumberConstraints(), addGeneralDAGConstraints(), addImsetVariables(), addKBestMECVariables(), BN_addMECNonRepetitionConstraint(), edge_constraint(), immorality_constraint(), is_dr_feasible(), is_feasible(), makeimsetvars(), PS_copyParentSetData(), PS_deallocateParentSetData(), PS_specialiseFor(), SCIP_DECL_CONSLOCK(), SCIP_DECL_CONSPROP(), setBranchingPriorities(), and setSpecialProperties().

Here is the call graph for this function:

◆ get_index()

int get_index ( char *  nodeName,
ParentSetData psd 
)

Gets the index of a named variable.

Adapted from function of same name in probdata_bn

Returns
the index of the given variable in the given parent sets data structure
Parameters
nodeName(the name of ) the variable
psdthe parent sets data structure, only nodeNames is set

References ParentSetData::n, and ParentSetData::nodeNames.

Referenced by parseSet(), and process_constraint().

◆ hashtableCreateArrow()

SCIP_RETCODE hashtableCreateArrow ( SCIP *  scip,
ParentSetData psd 
)

Creates a hash table.

Parameters
scipSCIP instance
psdParent set data structure containing hashtable

References ParentSetData::arrow, ParentSetData::edge, and ParentSetData::n.

Referenced by addArrowVariables(), PS_copyParentSetData(), PS_parse(), and PS_specialiseFor().

◆ hashtablefreeArrow()

SCIP_RETCODE hashtablefreeArrow ( SCIP *  scip,
ParentSetData psd 
)

Frees memory (previously) used by a hash table.

Parameters
scipSCIP instance
psdParent set data structure containing hashtable

References ParentSetData::n.

Referenced by PS_deallocateParentSetData().

◆ is_dr_feasible()

SCIP_Bool is_dr_feasible ( SCIP *  scip,
const ParentSetData psd,
SCIP_SOL *  sol,
SCIP_Bool  constructing,
SCIP_SOL *  dr_sol 
)
Parameters
scipSCIP data structure
psdParent set data structure
solDAG to check/use as input
constructingwhether we are constructing the distinguished representative (if any)
dr_soldr_sol is the constructed distinguished representative (if any)

References get_arrow(), get_arrowedge(), get_edge(), ParentSetData::n, ParentSetData::nParents, ParentSetData::nParentSets, ParentSetData::ParentSets, and ParentSetData::PaVars.

Referenced by SCIP_DECL_HEUREXEC().

Here is the call graph for this function:

◆ needsEscaping()

static SCIP_Bool needsEscaping ( char  item)
static

Whether a character needs an escape character adding before it can be written to fiel.

Parameters
itemThe character to consider
Returns
True if the character needs to be escaped. False otherwise.

Referenced by escapeString().

◆ put_arrow()

SCIP_RETCODE put_arrow ( SCIP *  scip,
ParentSetData psd,
const int  i,
const int  j,
SCIP_VAR *  arrow_i_j 
)

Store an arrow variable for specified child and parent.

Parameters
scipSCIP instance
psdthe parent sets data structure
ichild variable
jparent variable
arrow_i_jvariable to store

References put_arrowedge().

Referenced by addArrowVariables(), PS_copyParentSetData(), PS_parse(), and PS_specialiseFor().

Here is the call graph for this function:

◆ put_arrowedge()

static SCIP_RETCODE put_arrowedge ( SCIP *  scip,
ParentSetData psd,
int  i,
int  j,
SCIP_VAR *  arrow_i_j,
SCIP_Bool  arrow 
)
static

Store an arrow or edge variable for specified child and parent.

Parameters
scipSCIP instance
psdthe parent sets data structure
ichild variable
jparent variable
arrow_i_jvariable to store
arrowIf TRUE store arrow variable for i and j, else store edge variable for i and j

References ParentSetData::arrow, and ParentSetData::edge.

Referenced by put_arrow(), and put_edge().

◆ put_edge()

SCIP_RETCODE put_edge ( SCIP *  scip,
ParentSetData psd,
const int  i,
const int  j,
SCIP_VAR *  arrow_i_j 
)

Store an edge variable for specified child and parent.

Parameters
psdthe parent sets data structure
ichild variable
jparent variable
arrow_i_jvariable to store

References put_arrowedge().

Referenced by addArrowVariables(), PS_copyParentSetData(), PS_parse(), and PS_specialiseFor().

Here is the call graph for this function:

◆ unescapeString()

static SCIP_RETCODE unescapeString ( char *  input_string,
char **  output_string 
)
static

Removes an escape charcters from a string to return the string before it was escaped.

Parameters
input_stringThe initial string.
output_stringA copy of the string after any escape characters have been removed.
Returns
SCIP_OKAY if the operation succeeded.

References ESC_CHAR.

Referenced by UT_parseStringArray().

◆ UT_addBoolParam()

SCIP_RETCODE UT_addBoolParam ( SCIP *  scip,
const char *  name,
const char *  desc,
SCIP_Bool  value 
)

Adds a boolean parameter to those recognised by SCIP.

This is just a shortcut for SCIPaddBoolParam() with various options set to their most common values. Use the full function if you need any of the more advanced options.

Parameters
scipThe SCIP instance to add the parameter to.
nameThe parameter's name.
descA description of the parameter.
valueThe parameter's default value.
Returns
SCIP_OKAY if the operation suceeded. Otherwise an appropriate error message.

Referenced by BN_addParameters(), CC_addParams(), FC_addParams(), IO_addOutputParameters(), PD_addPedigreeParameters(), and SC_addScoringParameters().

◆ UT_addIntParam()

SCIP_RETCODE UT_addIntParam ( SCIP *  scip,
const char *  name,
const char *  desc,
int  value,
int  min,
int  max 
)

Adds an integer parameter to those recognised by SCIP.

This is just a shortcut for SCIPaddIntParam() with various options set to their most common values. Use the full function if you need any of the more advanced options.

Parameters
scipThe SCIP instance to add the parameter to.
nameThe parameter's name.
descA description of the parameter.
valueThe parameter's default value.
minThe parameter's minimum value.
maxThe parameter's maximum value.
Returns
SCIP_OKAY if the operation suceeded. Otherwise an appropriate error message.

Referenced by BN_addParameters(), IO_addOutputParameters(), PD_addPedigreeParameters(), and SC_addScoringParameters().

◆ UT_addLongintParam()

SCIP_RETCODE UT_addLongintParam ( SCIP *  scip,
const char *  name,
const char *  desc,
SCIP_Longint  value,
SCIP_Longint  min,
SCIP_Longint  max 
)

Adds a long integer parameter to those recognised by SCIP.

This is just a shortcut for SCIPaddLongintParam() with various options set to their most common values. Use the full function if you need any of the more advanced options.

Parameters
scipThe SCIP instance to add the parameter to.
nameThe parameter's name.
descA description of the parameter.
valueThe parameter's default value.
minThe parameter's minimum value.
maxThe parameter's maximum value.
Returns
SCIP_OKAY if the operation suceeded. Otherwise an appropriate error message.

Referenced by BN_addParameters().

◆ UT_addRealParam()

SCIP_RETCODE UT_addRealParam ( SCIP *  scip,
const char *  name,
const char *  desc,
SCIP_Real  value,
SCIP_Real  min,
SCIP_Real  max 
)

Adds a real valued parameter to those recognised by SCIP.

This is just a shortcut for SCIPaddRealParam() with various options set to their most common values. Use the full function if you need any of the more advanced options.

Parameters
scipThe SCIP instance to add the parameter to.
nameThe parameter's name.
descA description of the parameter.
minThe parameter's minimum value.
maxThe parameter's maximum value.
valueThe parameter's default value.
Returns
SCIP_OKAY if the operation suceeded. Otherwise an appropriate error message.

Referenced by BN_addParameters(), PD_addPedigreeParameters(), and SC_addScoringParameters().

◆ UT_addStringParam()

SCIP_RETCODE UT_addStringParam ( SCIP *  scip,
const char *  name,
const char *  desc,
const char *  value 
)

Adds a string parameter to those recognised by SCIP.

This is just a shortcut for SCIPaddStringParam() with various options set to their most common values. Use the full function if you need any of the more advanced options.

Parameters
scipThe SCIP instance to add the parameter to.
nameThe parameter's name.
descA description of the parameter.
valueThe parameter's default value.
Returns
SCIP_OKAY if the operation suceeded. Otherwise an appropriate error message.

Referenced by BN_addParameters(), IO_addOutputParameters(), and PD_addPedigreeParameters().

◆ UT_createEmptyGTEConstraint()

SCIP_RETCODE UT_createEmptyGTEConstraint ( SCIP *  scip,
SCIP_CONS **  cons,
const char *  name,
SCIP_Real  lhs 
)

Creates an initially empty greater than or equal to linear constraint with most options set to sensible defaults.

Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
lhsThe value the constraint should be greater than or equal to
Returns
SCIP_OKAY if the operation succeeded or an error code otherwise.

References UT_createEmptyLinearConstraint().

Here is the call graph for this function:

◆ UT_createEmptyLinearConstraint()

SCIP_RETCODE UT_createEmptyLinearConstraint ( SCIP *  scip,
SCIP_CONS **  cons,
const char *  name,
SCIP_Real  lhs,
SCIP_Real  rhs 
)

Creates an initially empty linear constraint with most options set to sensible defaults.

Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
lhsleft hand side of constraint
rhsright hand side of constraint
Returns
SCIP_OKAY if the operation succeeded or an error code otherwise.

Referenced by UT_createEmptyGTEConstraint(), and UT_createEmptyLTEConstraint().

◆ UT_createEmptyLTEConstraint()

SCIP_RETCODE UT_createEmptyLTEConstraint ( SCIP *  scip,
SCIP_CONS **  cons,
const char *  name,
SCIP_Real  rhs 
)

Creates an initially empty less than or equal to linear constraint with most options set to sensible defaults.

Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
rhsThe value the constraint should be less than or equal to
Returns
SCIP_OKAY if the operation succeeded or an error code otherwise.

References UT_createEmptyLinearConstraint().

Referenced by addFullSiblingAgeGapConstraint(), addHalfSiblingAgeGapConstraint(), addMaximumNumberOfOffspringConstraint(), addMaximumSibsetSizeConstraint(), and addSexConsistencyConstraint().

Here is the call graph for this function:

◆ UT_parseArray()

SCIP_RETCODE UT_parseArray ( char *  input_string,
char ***  output_array 
)

Parses an array from a string.

Use this function only if the array contains multiple types of items, or items that none of the other UT_parseXXXArray() functions deals with.

Parameters
input_stringThe string representation of the array to parse.
output_arrayThe array represented by the string.
Returns
SCIP_OKAY if the operation succeeded.

Referenced by PE_parse(), PR_parse(), PS_parse(), UT_parseIntArrayArray(), UT_parseIntArrayArrayArray(), UT_parseStringArray(), and UT_parseVarArrayArray().

◆ UT_parseCharArray()

SCIP_RETCODE UT_parseCharArray ( char *  input_string,
char **  output_array,
int  length 
)

Parses a character array from a string.

Parameters
input_stringThe string representation of the array to parse.
output_arrayThe array represented by the string.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

References UT_parseStringArray().

Referenced by PE_parse().

Here is the call graph for this function:

◆ UT_parseIntArray()

SCIP_RETCODE UT_parseIntArray ( char *  input_string,
int **  output_array,
int  length 
)

Parses an integer array from a string.

Parameters
input_stringThe string representation of the array to parse.
output_arrayThe array represented by the string.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

References UT_parseStringArray().

Referenced by PE_parse(), PS_parse(), and UT_parseIntArrayArray().

Here is the call graph for this function:

◆ UT_parseIntArrayArray()

SCIP_RETCODE UT_parseIntArrayArray ( char *  input_string,
int ***  output_array,
int *  lengths,
int  length 
)

Parses an array of integer arrays from a string.

Parameters
input_stringThe string representation of the array to parse.
output_arrayThe array represented by the string.
lengthsThe number of items in each sub array.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

References UT_parseArray(), and UT_parseIntArray().

Referenced by PS_parse(), and UT_parseIntArrayArrayArray().

Here is the call graph for this function:

◆ UT_parseIntArrayArrayArray()

SCIP_RETCODE UT_parseIntArrayArrayArray ( char *  input_string,
int ****  output_array,
int **  lengths,
int *  lengths_of_lengths,
int  length 
)

Parses an array of arrays of integer arrays from a string.

Parameters
input_stringThe string representation of the array to parse.
output_arrayThe array represented by the string.
lengthsThe number of items in each sub sub array.
lengths_of_lengthsThe number of items in each sub array.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

References UT_parseArray(), and UT_parseIntArrayArray().

Referenced by PS_parse().

Here is the call graph for this function:

◆ UT_parseStringArray()

SCIP_RETCODE UT_parseStringArray ( char *  input_string,
char ***  output_array,
int  length 
)

Parses a string array from a string.

Parameters
input_stringThe string representation of the array to parse.
output_arrayThe array represented by the string.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

References unescapeString(), and UT_parseArray().

Referenced by PR_parse(), PS_parse(), UT_parseCharArray(), UT_parseIntArray(), and UT_parseVarArray().

Here is the call graph for this function:

◆ UT_parseVarArray()

SCIP_RETCODE UT_parseVarArray ( SCIP *  scip,
char *  input_string,
SCIP_VAR ***  output_array,
int  length 
)

Parses a variable array from a string.

The variables are found from their names in the input. It is therefore important that the SCIP instance knows the variables so that they can be found from these names.

Parameters
scipThe SCIP instance in which the variables appear.
input_stringThe string representation of the array to parse.
output_arrayThe array represented by the string.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

References UT_parseStringArray().

Referenced by PE_parse(), and UT_parseVarArrayArray().

Here is the call graph for this function:

◆ UT_parseVarArrayArray()

SCIP_RETCODE UT_parseVarArrayArray ( SCIP *  scip,
char *  input_string,
SCIP_VAR ****  output_array,
int *  lengths,
int  length 
)

Parses an array of variable arrays from a string.

The variables are found from their names in the input. It is therefore important that the SCIP instance knows the variables so that they can be found from these names.

Parameters
scipThe SCIP instance in which the variables appear.
input_stringThe string representation of the array to parse.
output_arrayThe array represented by the string.
lengthsThe number of items in each sub array.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

References UT_parseArray(), and UT_parseVarArray().

Referenced by PS_parse().

Here is the call graph for this function:

◆ UT_readFileAndSplit()

SCIP_RETCODE UT_readFileAndSplit ( SCIP *  scip,
FILE *  file,
char *  splitters,
int  num_splitters,
SCIP_Bool  multiple_splitters_as_one,
char ****  lines,
int *  num_lines,
int **  line_lengths 
)

Reads a file and splits it into lines, which are themselves split into white space delimited tokens.

Parameters
scipThe SCIP instance being used.
fileThe file to read.
linesA pointer to the lines of text that are read from the file.
splittersThe field delimiters to use.
num_splittersThe number of field delimiters to use.
multiple_splitters_as_oneWhether multiple field delimiters should be merged in to one.
num_linesThe number of lines of text read.
line_lengthsThe number of tokens in each line.
Returns
SCIP_OKAY if the file was correctly read or a NULL pointer otherwise.either check that a DAG is the distinguished representative of its Markov equivalence class or construct the distinguished representative
If just checking, return whether the input DAG is the distinguished representative of its Markov equivalence class. If constructing, return whether it is possible to construct the distinguished representative.

Referenced by lookup(), readFrequencyFile(), and readProblemFromFile().

◆ UT_writeCharArray()

SCIP_RETCODE UT_writeCharArray ( SCIP *  scip,
FILE *  file,
char *  input_array,
int  length 
)

Writes an array of characters to a file.

Parameters
scipThe SCIP instance that the data belongs to.
fileThe file to write to.
input_arrayThe character array to write to file.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

References UT_writeStringArray().

Here is the call graph for this function:

◆ UT_writeIntArray()

SCIP_RETCODE UT_writeIntArray ( SCIP *  scip,
FILE *  file,
int *  input_array,
int  length 
)

Writes an array of integers to a file.

Parameters
scipThe SCIP instance that the data belongs to.
fileThe file to write to.
input_arrayThe integer array to write to file.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

References UT_writeStringArray().

Here is the call graph for this function:

◆ UT_writeIntArrayArray()

SCIP_RETCODE UT_writeIntArrayArray ( SCIP *  scip,
FILE *  file,
int **  input_array,
int *  lengths,
int  length 
)

Writes an array of arrays of integers to a file.

Parameters
scipThe SCIP instance that the data belongs to.
fileThe file to write to.
input_arrayThe integer array array to write to file.
lengthsThe number of items in each sub array.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

◆ UT_writeIntArrayArrayArray()

SCIP_RETCODE UT_writeIntArrayArrayArray ( SCIP *  scip,
FILE *  file,
int ***  input_array,
int **  lengths,
int *  lengths_of_lengths,
int  length 
)

Writes an array of arrays of arrays of integers to a file.

Parameters
scipThe SCIP instance that the data belongs to.
fileThe file to write to.
input_arrayThe integer array array array to write to file.
lengthsThe number of items in each sub sub array.
lengths_of_lengthsThe number of items in each sub array.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

◆ UT_writeStringArray()

SCIP_RETCODE UT_writeStringArray ( SCIP *  scip,
FILE *  file,
char **  input_array,
int  length 
)

Writes an array of strings to a file.

Parameters
scipThe SCIP instance that the data belongs to.
fileThe file to write to.
input_arrayThe string array to write to file.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

Referenced by UT_writeCharArray(), UT_writeIntArray(), and UT_writeVarArray().

◆ UT_writeVarArray()

SCIP_RETCODE UT_writeVarArray ( SCIP *  scip,
FILE *  file,
SCIP_VAR **  input_array,
int  length 
)

Writes the names of an array of variables to a file.

Parameters
scipThe SCIP instance that the data belongs to.
fileThe file to write to.
input_arrayThe variable array to write to file.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.

References UT_writeStringArray().

Here is the call graph for this function:

◆ UT_writeVarArrayArray()

SCIP_RETCODE UT_writeVarArrayArray ( SCIP *  scip,
FILE *  file,
SCIP_VAR ***  input_array,
int *  lengths,
int  length 
)

Writes an array of arrays of variables to a file.

Parameters
scipThe SCIP instance that the data belongs to.
fileThe file to write to.
input_arrayThe variable array array to write to file.
lengthsThe number of items in each sub array.
lengthThe number of items in the array.
Returns
SCIP_OKAY if the operation succeeded.