Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

methods to copy problems between a source and a target SCIP

Functions

SCIP_RETCODE SCIPcopyPlugins (SCIP *sourcescip, SCIP *targetscip, SCIP_Bool copyreaders, SCIP_Bool copypricers, SCIP_Bool copyconshdlrs, SCIP_Bool copyconflicthdlrs, SCIP_Bool copypresolvers, SCIP_Bool copyrelaxators, SCIP_Bool copyseparators, SCIP_Bool copycutselectors, SCIP_Bool copypropagators, SCIP_Bool copyheuristics, SCIP_Bool copyeventhdlrs, SCIP_Bool copynodeselectors, SCIP_Bool copybranchrules, SCIP_Bool copydisplays, SCIP_Bool copydialogs, SCIP_Bool copytables, SCIP_Bool copyexprhdlrs, SCIP_Bool copynlpis, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
 
SCIP_RETCODE SCIPcopyBenders (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_Bool threadsafe, SCIP_Bool *valid)
 
SCIP_RETCODE SCIPcopyProb (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, const char *name)
 
SCIP_RETCODE SCIPcopyOrigProb (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name)
 
SCIP_RETCODE SCIPenableConsCompression (SCIP *scip)
 
SCIP_Bool SCIPisConsCompressionEnabled (SCIP *scip)
 
SCIP_RETCODE SCIPgetVarCopy (SCIP *sourcescip, SCIP *targetscip, SCIP_VAR *sourcevar, SCIP_VAR **targetvar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *success)
 
SCIP_RETCODE SCIPcopyVars (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool global)
 
SCIP_RETCODE SCIPcopyOrigVars (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars)
 
SCIP_RETCODE SCIPmergeVariableStatistics (SCIP *sourcescip, SCIP *targetscip, SCIP_VAR **sourcevars, SCIP_VAR **targetvars, int nvars)
 
void SCIPmergeNLPIStatistics (SCIP *sourcescip, SCIP *targetscip, SCIP_Bool reset)
 
SCIP_RETCODE SCIPtranslateSubSol (SCIP *scip, SCIP *subscip, SCIP_SOL *subsol, SCIP_HEUR *heur, SCIP_VAR **subvars, SCIP_SOL **newsol)
 
SCIP_RETCODE SCIPtranslateSubSols (SCIP *scip, SCIP *subscip, SCIP_HEUR *heur, SCIP_VAR **subvars, SCIP_Bool *success, int *solindex)
 
SCIP_RETCODE SCIPgetConsCopy (SCIP *sourcescip, SCIP *targetscip, SCIP_CONS *sourcecons, SCIP_CONS **targetcons, SCIP_CONSHDLR *sourceconshdlr, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name, 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, SCIP_Bool global, SCIP_Bool *valid)
 
SCIP_RETCODE SCIPcopyConss (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool *valid)
 
SCIP_RETCODE SCIPcopyOrigConss (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool enablepricing, SCIP_Bool *valid)
 
SCIP_RETCODE SCIPconvertCutsToConss (SCIP *scip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
 
SCIP_RETCODE SCIPcopyCuts (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
 
SCIP_RETCODE SCIPcopyConflicts (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool *valid)
 
SCIP_RETCODE SCIPcopyImplicationsCliques (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *infeasible, int *nbdchgs, int *ncopied)
 
SCIP_RETCODE SCIPcopyParamSettings (SCIP *sourcescip, SCIP *targetscip)
 
int SCIPgetSubscipDepth (SCIP *scip)
 
void SCIPsetSubscipDepth (SCIP *scip, int newdepth)
 
SCIP_RETCODE SCIPcopy (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool threadsafe, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
 
SCIP_RETCODE SCIPcopyConsCompression (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool threadsafe, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
 
SCIP_RETCODE SCIPcopyOrig (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool enablepricing, SCIP_Bool threadsafe, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
 
SCIP_RETCODE SCIPcopyOrigConsCompression (SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool enablepricing, SCIP_Bool threadsafe, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
 
SCIP_RETCODE SCIPcheckCopyLimits (SCIP *sourcescip, SCIP_Bool *success)
 
SCIP_RETCODE SCIPcopyLimits (SCIP *sourcescip, SCIP *targetscip)
 
SCIP_RETCODE SCIPsetCommonSubscipParams (SCIP *sourcescip, SCIP *subscip, SCIP_Longint nsubnodes, SCIP_Longint nstallnodes, int bestsollimit)
 

Function Documentation

◆ SCIPcopyPlugins()

SCIP_RETCODE SCIPcopyPlugins ( SCIP sourcescip,
SCIP targetscip,
SCIP_Bool  copyreaders,
SCIP_Bool  copypricers,
SCIP_Bool  copyconshdlrs,
SCIP_Bool  copyconflicthdlrs,
SCIP_Bool  copypresolvers,
SCIP_Bool  copyrelaxators,
SCIP_Bool  copyseparators,
SCIP_Bool  copycutselectors,
SCIP_Bool  copypropagators,
SCIP_Bool  copyheuristics,
SCIP_Bool  copyeventhdlrs,
SCIP_Bool  copynodeselectors,
SCIP_Bool  copybranchrules,
SCIP_Bool  copydisplays,
SCIP_Bool  copydialogs,
SCIP_Bool  copytables,
SCIP_Bool  copyexprhdlrs,
SCIP_Bool  copynlpis,
SCIP_Bool  passmessagehdlr,
SCIP_Bool valid 
)

copies plugins from sourcescip to targetscip; in case that a constraint handler which does not need constraints cannot be copied, valid will return FALSE. All plugins can declare that, if their copy process failed, the copied SCIP instance might not represent the same problem semantics as the original. Note that in this case dual reductions might be invalid.

Note
In a multi thread case, you need to lock the copying procedure from outside with a mutex. Also, 'passmessagehdlr' should be set to FALSE.
Do not change the source SCIP environment during the copying process.
This method does not copy Benders' plugins. To this end, the method SCIPcopyBenders() must be called separately.
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Postcondition
After calling this method targetscip reaches one of the following stages depending on if and when the solution process was interrupted:
Note
sourcescip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

copies plugins from sourcescip to targetscip; in case that a constraint handler which does not need constraints cannot be copied, valid will return FALSE. All plugins can declare that, if their copy process failed, the copied SCIP instance might not represent the same problem semantics as the original. Note that in this case dual reductions might be invalid.

Note
In a multi thread case, you need to lock the copying procedure from outside with a mutex. Also, 'passmessagehdlr' should be set to FALSE.
Do not change the source SCIP environment during the copying process
This method does not copy Benders' plugins. To this end, the method SCIPcopyBenders() must be called separately.
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Postcondition
After calling this method targetscip reaches one of the following stages depending on if and when the solution process was interrupted:
Note
sourcescip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
copyreadersshould the file readers be copied
copypricersshould the variable pricers be copied
copyconshdlrsshould the constraint handlers be copied
copyconflicthdlrsshould the conflict handlers be copied
copypresolversshould the presolvers be copied
copyrelaxatorsshould the relaxation handlers be copied
copyseparatorsshould the separators be copied
copycutselectorsshould the cut selectors be copied
copypropagatorsshould the propagators be copied
copyheuristicsshould the heuristics be copied
copyeventhdlrsshould the event handlers be copied
copynodeselectorsshould the node selectors be copied
copybranchrulesshould the branchrules be copied
copydisplaysshould the display columns be copied
copydialogsshould the dialogs be copied
copytablesshould the statistics tables be copied
copyexprhdlrsshould the expression handlers be copied
copynlpisshould the NLPIs be copied
passmessagehdlrshould the message handler be passed
validpointer to store whether plugins, in particular all constraint handlers which do not need constraints were validly copied

Definition at line 275 of file scip_copy.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcheckStage(), SCIPgetMessagehdlr(), SCIPsetCopyPlugins(), SCIPsetMessagehdlr(), Scip::set, and TRUE.

Referenced by createSubscip(), createSubSCIP(), doCopy(), SCIPbendersApplyDecomposition(), and setupSubscipLpface().

◆ SCIPcopyBenders()

SCIP_RETCODE SCIPcopyBenders ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_Bool  threadsafe,
SCIP_Bool valid 
)

copies all Benders' decomposition plugins

Note
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
the 'threadsafe' parameter must be set to TRUE if you are absolutely certain that the source and target SCIP instances will be solved in parallel. The usual case is to set this to FALSE, since thread safety typically incurs a performance cost.
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Postcondition
After calling this method targetscip reaches one of the following stages depending on if and when the solution process was interrupted:
Note
sourcescip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

copies all Benders' decomposition plugins

Note
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
the 'threadsafe' parameter should only be set to TRUE if you are absolutely certain that the source and target SCIP instances will be solved in parallel. The usual case is to set this to FALSE, since thread safety typically incurs a performance cost.
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Postcondition
After calling this method targetscip reaches one of the following stages depending on if and when the solution process was interrupted:
Note
sourcescip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables corresponding target variables; if NULL the transfer of cuts is not possible
threadsafeFALSE, if data can be safely shared between the source and target SCIP, otherwise TRUE. This is usually set to FALSE
validpointer to store whether all plugins were validly copied

Definition at line 357 of file scip_copy.c.

References SCIP_Set::benders, FALSE, SCIP_Set::nbenders, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPbendersCopyInclude(), SCIPcheckStage(), Scip::set, and TRUE.

Referenced by doCopy().

◆ SCIPcopyProb()

SCIP_RETCODE SCIPcopyProb ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
SCIP_Bool  global,
const char *  name 
)

create a problem by copying the problem data of the source SCIP

Note
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Postcondition
After calling this method targetscip reaches one of the following stages depending on if and when the solution process was interrupted:
Note
sourcescip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
globalcreate a global or a local copy?
nameproblem name of target

Definition at line 527 of file scip_copy.c.

References copyProb(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcheckStage(), and TRUE.

Referenced by copyToSubscip(), createSubSCIP(), and doCopy().

◆ SCIPcopyOrigProb()

SCIP_RETCODE SCIPcopyOrigProb ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
const char *  name 
)

create a problem by copying the original problem data of the source SCIP

Note
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Postcondition
After calling this method targetscip reaches one of the following stages depending on if and when the solution process was interrupted:
Note
sourcescip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
nameproblem name of target

Definition at line 580 of file scip_copy.c.

References copyProb(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddOrigObjoffset(), SCIPcheckStage(), SCIPgetObjsense(), SCIPgetOrigObjoffset(), SCIPsetObjsense(), and TRUE.

Referenced by doCopy().

◆ SCIPenableConsCompression()

SCIP_RETCODE SCIPenableConsCompression ( SCIP scip)

enables constraint compression.

If constraint compression is enabled, fixed variables will be treated as constants by all constraints that are copied after calling this method.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipsource SCIP data structure

Definition at line 621 of file scip_copy.c.

References FALSE, NULL, Scip::origprob, SCIP_CALL, SCIP_OKAY, SCIPcheckStage(), SCIPprobEnableConsCompression(), and TRUE.

Referenced by doCopy().

◆ SCIPisConsCompressionEnabled()

SCIP_Bool SCIPisConsCompressionEnabled ( SCIP scip)

is constraint compression enabled?

If constraint compression is enabled, fixed variables can be treated as constants by all constraints that are copied after calling this method.

Returns
TRUE if problem constraint compression is enabled, otherwise FALSE
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipsource SCIP data structure

Definition at line 660 of file scip_copy.c.

References FALSE, NULL, Scip::origprob, SCIP_CALL_ABORT, SCIP_STAGE_PROBLEM, SCIPcheckStage(), SCIPgetStage(), SCIPprobIsConsCompressionEnabled(), and TRUE.

Referenced by consdataCreate(), consdataCreateRedundant(), and copyConsPseudoboolean().

◆ SCIPgetVarCopy()

SCIP_RETCODE SCIPgetVarCopy ( SCIP sourcescip,
SCIP targetscip,
SCIP_VAR sourcevar,
SCIP_VAR **  targetvar,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
SCIP_Bool  global,
SCIP_Bool success 
)

returns copy of the source variable; if there already is a copy of the source variable in the variable hash map, it is just returned as target variable; otherwise, if the variables it not marked as relaxation-only, a new variable will be created and added to the target SCIP; this created variable is added to the variable hash map and returned as target variable; relaxation-only variables are not copied and FALSE is returned in *success

Note
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
if a new variable was created, this variable will be added to the target-SCIP, but it is not captured
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
targetscip stage does not get changed
sourcescip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
sourcevarsource variable
targetvarpointer to store the target variable
varmapa hashmap to store the mapping of source variables to the corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
globalshould global or local bounds be used?
successpointer to store whether the copying was successful or not

Definition at line 711 of file scip_copy.c.

References FALSE, Scip::mem, NULL, SCIP_Mem::probmem, SCIP_Var::scip, SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_STAGE_PROBLEM, SCIP_VARSTATUS_AGGREGATED, SCIP_VARSTATUS_COLUMN, SCIP_VARSTATUS_FIXED, SCIP_VARSTATUS_LOOSE, SCIP_VARSTATUS_MULTAGGR, SCIP_VARSTATUS_NEGATED, SCIP_VARSTATUS_ORIGINAL, SCIPABORT, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPallocBufferArray, SCIPblkmem(), SCIPcheckStage(), SCIPcreateConsLinear(), SCIPerrorMessage, SCIPflattenVarAggregationGraph(), SCIPfreeBufferArray, SCIPgetNConss(), SCIPgetNegatedVar(), SCIPgetNVars(), SCIPgetStage(), SCIPgetVarCopy(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsnprintf(), SCIPvarCopy(), SCIPvarGetAggrConstant(), SCIPvarGetAggrScalar(), SCIPvarGetAggrVar(), SCIPvarGetMultaggrConstant(), SCIPvarGetMultaggrNVars(), SCIPvarGetMultaggrScalars(), SCIPvarGetMultaggrVars(), SCIPvarGetName(), SCIPvarGetNegationVar(), SCIPvarGetStatus(), SCIPvarIsRelaxationOnly(), Scip::set, Scip::stat, and TRUE.

Referenced by copyConsPseudoboolean(), copyCuts(), copyToSubscip(), copyVars(), tsp::ProbDataTSP::scip_copy(), SCIP_DECL_CONSCOPY(), SCIP_DECL_EXPR_MAPEXPR(), SCIP_DECL_PROBCOPY(), SCIPcopyConsLinear(), SCIPcopyImplicationsCliques(), and SCIPgetVarCopy().

◆ SCIPcopyVars()

SCIP_RETCODE SCIPcopyVars ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
SCIP_VAR **  fixedvars,
SCIP_Real fixedvals,
int  nfixedvars,
SCIP_Bool  global 
)

Copies all active (thus unfixed) variables from source-SCIP, except those that are marked as relaxation only, and adds these variable to the target-SCIP.

The mapping between these variables are stored in the variable hashmap.

The target-SCIP has to be in problem creation stage.

Note
the variables are added to the target-SCIP but not captured
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables to the corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
fixedvarssource variables whose copies should be fixed in the target SCIP environment, or NULL
fixedvalsarray of fixing values for target SCIP variables, or NULL
nfixedvarsnumber of source variables whose copies should be fixed in the target SCIP environment, or NULL
globalshould global or local bounds be used?

Definition at line 1178 of file scip_copy.c.

References copyVars(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcheckStage(), and TRUE.

Referenced by createSubSCIP(), SCIPcopyLargeNeighborhoodSearch(), and setupSubscipLpface().

◆ SCIPcopyOrigVars()

SCIP_RETCODE SCIPcopyOrigVars ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
SCIP_VAR **  fixedvars,
SCIP_Real fixedvals,
int  nfixedvars 
)

copies all original variables from source-SCIP and adds these variable to the target-SCIP; the mapping between these variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed and aggregated variables do not get copied

Note
the variables are added to the target-SCIP but not captured
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables to the corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
fixedvarssource variables whose copies should be fixed in the target SCIP environment, or NULL
fixedvalsarray of fixing values for target SCIP variables, or NULL
nfixedvarsnumber of source variables whose copies should be fixed in the target SCIP environment, or NULL

Definition at line 1235 of file scip_copy.c.

References copyVars(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcheckStage(), and TRUE.

◆ SCIPmergeVariableStatistics()

SCIP_RETCODE SCIPmergeVariableStatistics ( SCIP sourcescip,
SCIP targetscip,
SCIP_VAR **  sourcevars,
SCIP_VAR **  targetvars,
int  nvars 
)

merges the histories of variables from a source SCIP into a target SCIP. The two data structures should point to different SCIP instances.

Note
the notion of source and target is inverted here; sourcescip usually denotes a copied SCIP instance, whereas targetscip denotes the original instance
Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
sourcevarssource variables for history merge, NULL entries are ignored
targetvarstarget variables for history merge, NULL entries are ignored
nvarsnumber of variables in both variable arrays

Definition at line 1265 of file scip_copy.c.

References SCIP_Set::history_allowmerge, NULL, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIP_VARSTATUS_COLUMN, SCIP_VARSTATUS_ORIGINAL, SCIPgetOrigObjoffset(), SCIPgetOrigObjscale(), SCIPgetStage(), SCIPsetIsEQ(), SCIPvarGetStatus(), SCIPvarGetTransVar(), SCIPvarMergeHistories(), Scip::set, and Scip::stat.

Referenced by setupAndSolveSubscip(), setupAndSolveSubscipCrossover(), setupAndSolveSubscipMutation(), solveSubproblem(), and wrapperRins().

◆ SCIPmergeNLPIStatistics()

void SCIPmergeNLPIStatistics ( SCIP sourcescip,
SCIP targetscip,
SCIP_Bool  reset 
)

merges the statistics of NLPIs from a source SCIP into a target SCIP

The two SCIP instances should point to different SCIP instances.

Note
the notion of source and target is inverted here; sourcescip usually denotes a copied SCIP instance, whereas targetscip denotes the original instance
Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
resetwhether to reset statistics in sourcescip

Definition at line 1330 of file scip_copy.c.

References SCIP_Set::nlpis, SCIP_Set::nnlpis, NULL, SCIPdebugMsg, SCIPnlpiGetName(), SCIPnlpiMergeStatistics(), SCIPsetFindNlpi(), and Scip::set.

Referenced by solveSubNLP().

◆ SCIPtranslateSubSol()

SCIP_RETCODE SCIPtranslateSubSol ( SCIP scip,
SCIP subscip,
SCIP_SOL subsol,
SCIP_HEUR heur,
SCIP_VAR **  subvars,
SCIP_SOL **  newsol 
)

translates a solution from a subscip to the main scip

Variables that are relaxation-only in the master SCIP are set to 0 or the bound closest to 0. Such variables are represented as NULL entry in the subvars array.

Note
This method allocates a new solution of the main scip that needs to be freed by the user.
Parameters
scipSCIP data structure of the original problem
subscipSCIP data structure of the subproblem
subsolsolution of the subproblem
heurheuristic that found the solution
subvarsthe variables from the subproblem in the same order as the main scip
newsolbuffer to store pointer to created solution in main SCIP

Definition at line 1408 of file scip_copy.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreateSol(), SCIPfreeBufferArray, SCIPgetVarsData(), SCIPsetSolVals(), and translateSubSol().

Referenced by createNewSol(), reoptimize(), setupAndSolve(), setupAndSolveSubscip(), setupAndSolveSubscipRapidlearning(), solveSubproblem(), and transferSolution().

◆ SCIPtranslateSubSols()

SCIP_RETCODE SCIPtranslateSubSols ( SCIP scip,
SCIP subscip,
SCIP_HEUR heur,
SCIP_VAR **  subvars,
SCIP_Bool success,
int *  solindex 
)

checks the solutions from the subscip and adds the first one that is found feasible to the master SCIP

Variables that are relaxation-only in the master SCIP are set to 0 or the bound closest to 0. Such variables are represented as NULL entry in the subvars array.

Parameters
scipthe SCIP data structure
subscipSCIP data structure of the subproblem
heurheuristic that found the solution
subvarsthe variables from the subproblem in the same order as the main scip
successpointer to store, whether new solution was found
solindexpointer to store solution index of stored solution, or NULL if not of interest

Definition at line 1448 of file scip_copy.c.

References FALSE, NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPaddSolFree(), SCIPallocBufferArray, SCIPcheckSol(), SCIPclearSol(), SCIPcreateSol(), SCIPdebugMsg, SCIPfreeBufferArray, SCIPfreeSol(), SCIPgetNSols(), SCIPgetSolOrigObj(), SCIPgetSols(), SCIPgetSolTransObj(), SCIPgetVarsData(), SCIPsetSolVals(), SCIPsolGetIndex(), translateSubSol(), and TRUE.

Referenced by createNewSols(), SCIP_DECL_HEUREXEC(), setupAndSolveSubscip(), setupAndSolveSubscipCrossover(), setupAndSolveSubscipLocalbranching(), setupAndSolveSubscipMutation(), setupAndSolveSubscipOneopt(), setupAndSolveSubscipTrustregion(), solveSubscipLpface(), wrapperDins(), and wrapperRins().

◆ SCIPgetConsCopy()

SCIP_RETCODE SCIPgetConsCopy ( SCIP sourcescip,
SCIP targetscip,
SCIP_CONS sourcecons,
SCIP_CONS **  targetcons,
SCIP_CONSHDLR sourceconshdlr,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
const char *  name,
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,
SCIP_Bool  global,
SCIP_Bool valid 
)

returns copy of the source constraint; if there already is a copy of the source constraint in the constraint hash map, it is just returned as target constraint; elsewise a new constraint will be created; this created constraint is added to the constraint hash map and returned as target constraint; the variable map is used to map the variables of the source SCIP to the variables of the target SCIP

Warning
If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may be declared feasible even if it violates this particular constraint. This constellation should only be used, if no LP or pseudo solution can violate the constraint – e.g. if a local constraint is redundant due to the variable's local bounds.
Note
The constraint is not added to the target SCIP. You can check whether a constraint is added by calling SCIPconsIsAdded(). (If you mix SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already added.)
The constraint is always captured, either during the creation of the copy or after finding the copy of the constraint in the constraint hash map
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
sourceconssource constraint of the source SCIP
targetconspointer to store the created target constraint
sourceconshdlrsource constraint handler for this constraint
varmapa SCIP_HASHMAP mapping variables of the source SCIP to the corresponding variables of the target SCIP, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
namename of constraint, or NULL if the name of the source constraint should be used
initialshould the LP relaxation of constraint be in the initial LP?
separateshould the constraint be separated during LP processing?
enforceshould the constraint be enforced during node processing?
checkshould the constraint be checked for feasibility?
propagateshould the constraint be propagated during node processing?
localis constraint only valid locally?
modifiableis constraint modifiable (subject to column generation)?
dynamicis constraint subject to aging?
removableshould the relaxation be removed from the LP due to aging or cleanup?
stickingatnodeshould the constraint always be kept at the node where it was added, even if it may be moved to a more global node?
globalcreate a global or a local copy?
validpointer to store whether the copying was valid or not

Definition at line 1591 of file scip_copy.c.

References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPblkmem(), SCIPcaptureCons(), SCIPcheckStage(), SCIPconsCopy(), SCIPgetNConss(), SCIPgetNVars(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPhashmapInsert(), Scip::set, and TRUE.

Referenced by addConstraintToBendersSubproblem(), addScenarioConsToProb(), copyConsPseudoboolean(), copyToSubscip(), SCIP_DECL_CONSCOPY(), SCIPbendersMergeSubproblemIntoMaster(), SCIPcopyConflicts(), SCIPcopyConss(), SCIPcopyOrigConss(), and setupAndSolveSubscipRapidlearning().

◆ SCIPcopyConss()

SCIP_RETCODE SCIPcopyConss ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
SCIP_Bool  global,
SCIP_Bool  enablepricing,
SCIP_Bool valid 
)

copies constraints from the source-SCIP and adds these to the target-SCIP; for mapping the variables between the source and the target SCIP a hash map can be given; if the variable hash map is NULL or necessary variable mapping is missing, the required variables are created in the target-SCIP and added to the hash map, if not NULL; all variables which are created are added to the target-SCIP but not (user) captured; if the constraint hash map is not NULL the mapping between the constraints of the source and target-SCIP is stored

*valid is set to TRUE iff all constraints that are marked as checked or enforced were copied successfully. If other constraints could not be copied, *valid can still be set to TRUE.

Note
the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already added.) You can check whether a constraint is added by calling SCIPconsIsAdded().
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa SCIP_HASHMAP mapping variables of the source SCIP to the corresponding variables of the target SCIP, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
globalcreate a global or a local copy?
enablepricingshould pricing be enabled in copied SCIP instance? If TRUE, the modifiable flag of constraints will be copied.
validpointer to store whether all checked or enforced constraints were validly copied

Definition at line 1730 of file scip_copy.c.

References Scip::conflictstore, FALSE, Scip::mem, NULL, SCIP_Mem::probmem, Scip::reopt, SCIP_Bool, SCIP_CALL, SCIP_CONFTYPE_UNKNOWN, SCIP_OKAY, SCIPaddCons(), SCIPblkmem(), SCIPcheckStage(), SCIPconflictstoreAddConflict(), SCIPconsGetName(), SCIPconshdlrGetCheckConss(), SCIPconshdlrGetConss(), SCIPconshdlrGetNActiveConss(), SCIPconshdlrGetName(), SCIPconshdlrGetNCheckConss(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsConflict(), SCIPconsIsDeleted(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsSetModifiable(), SCIPdebugMsg, SCIPgetConsCopy(), SCIPgetConshdlrs(), SCIPgetNConshdlrs(), SCIPgetNConss(), SCIPgetNVars(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPinfinity(), SCIPreleaseCons(), Scip::set, Scip::stat, and TRUE.

Referenced by createSubSCIP(), and doCopy().

◆ SCIPcopyOrigConss()

SCIP_RETCODE SCIPcopyOrigConss ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
SCIP_Bool  enablepricing,
SCIP_Bool valid 
)

copies all original constraints from the source-SCIP and adds these to the target-SCIP; for mapping the variables between the source and the target SCIP a hash map can be given; if the variable hash map is NULL or necessary variable mapping is missing, the required variables are created in the target-SCIP and added to the hash map, if not NULL; all variables which are created are added to the target-SCIP but not (user) captured; if the constraint hash map is not NULL the mapping between the constraints of the source and target-SCIP is stored

Note
the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already added.) You can check whether a constraint is added by calling SCIPconsIsAdded().
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa SCIP_HASHMAP mapping variables of the source SCIP to the corresponding variables of the target SCIP, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
enablepricingshould pricing be enabled in copied SCIP instance? If TRUE, the modifiable flag of constraints will be copied.
validpointer to store whether all constraints were validly copied

Definition at line 1935 of file scip_copy.c.

References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPaddCons(), SCIPblkmem(), SCIPcheckStage(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsModifiable(), SCIPconsIsOriginal(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsSetModifiable(), SCIPdebugMsg, SCIPgetConsCopy(), SCIPgetNConss(), SCIPgetNOrigConss(), SCIPgetNVars(), SCIPgetOrigConss(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPreleaseCons(), and TRUE.

Referenced by doCopy().

◆ SCIPconvertCutsToConss()

SCIP_RETCODE SCIPconvertCutsToConss ( SCIP scip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
SCIP_Bool  global,
int *  ncutsadded 
)

convert all active cuts from cutpool to linear constraints

Note
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Note
SCIP stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varmapa hashmap to store the mapping of source variables corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
globalcreate a global or a local copy?
ncutsaddedpointer to store number of added cuts, or NULL

Definition at line 2068 of file scip_copy.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPcheckStage(), SCIPcopyCuts(), Scip::set, SCIP_Set::stage, and TRUE.

Referenced by SCIP_DECL_CONSEXITSOL().

◆ SCIPcopyCuts()

SCIP_RETCODE SCIPcopyCuts ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
SCIP_Bool  global,
int *  ncutsadded 
)

copies all active cuts from cutpool of sourcescip to linear constraints in targetscip

Cuts that contain variables that are marked as relaxation-only are skipped.

Note
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
globalcreate a global or a local copy?
ncutsaddedpointer to store number of copied cuts, or NULL

Definition at line 2130 of file scip_copy.c.

References copyCuts(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPcheckStage(), SCIPdebugMsg, SCIPfindConshdlr(), SCIPgetDelayedPoolCuts(), SCIPgetNDelayedPoolCuts(), SCIPgetNPoolCuts(), SCIPgetPoolCuts(), Scip::set, SCIP_Set::stage, and TRUE.

Referenced by SCIP_DECL_HEUREXEC(), SCIPconvertCutsToConss(), SCIPcopyLargeNeighborhoodSearch(), setupAndSolveSubscip(), setupAndSolveSubscipRapidlearning(), setupProbingSCIP(), setupSubscipLpface(), and solveSubproblem().

◆ SCIPcopyConflicts()

SCIP_RETCODE SCIPcopyConflicts ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
SCIP_Bool  global,
SCIP_Bool  enablepricing,
SCIP_Bool valid 
)

copies all active conflicts from the conflict pool of sourcescip and adds them as linear constraints to targetscip

Note
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not change
targetscip stage does not change

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
globalcreate a global or a local copy?
enablepricingshould pricing be enabled in copied SCIP instance? If TRUE, the modifiable flag of constraints will be copied.
validpointer to store whether all constraints were validly copied

Definition at line 2222 of file scip_copy.c.

References Scip::conflictstore, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPaddCons(), SCIPallocBufferArray, SCIPblkmem(), SCIPcheckStage(), SCIPconflictstoreGetConflicts(), SCIPconflictstoreGetNConflictsInStore(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsConflict(), SCIPconsIsDeleted(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsSetModifiable(), SCIPdebugMsg, SCIPgetConsCopy(), SCIPgetNConss(), SCIPgetNVars(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPreleaseCons(), and TRUE.

◆ SCIPcopyImplicationsCliques()

SCIP_RETCODE SCIPcopyImplicationsCliques ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
SCIP_Bool  global,
SCIP_Bool infeasible,
int *  nbdchgs,
int *  ncopied 
)

copies implications and cliques of sourcescip to targetscip

This function should be called for a targetscip in transformed stage. It can save time in presolving of the targetscip, since implications and cliques are copied.

Note
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
globalcreate a global or a local copy?
infeasiblepointer to store whether an infeasibility was detected
nbdchgspointer to store the number of performed bound changes, or NULL
ncopiedpointer to store number of copied implications and cliques, or NULL

Definition at line 2380 of file scip_copy.c.

References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddClique(), SCIPaddVarImplication(), SCIPallocBufferArray, SCIPcheckStage(), SCIPcliqueGetNVars(), SCIPcliqueGetValues(), SCIPcliqueGetVars(), SCIPcliqueIsEquation(), SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetCliques(), SCIPgetNCliques(), SCIPgetVarCopy(), SCIPgetVarsData(), SCIPvarGetImplBounds(), SCIPvarGetImplTypes(), SCIPvarGetImplVars(), SCIPvarGetName(), SCIPvarGetNImpls(), and TRUE.

◆ SCIPcopyParamSettings()

SCIP_RETCODE SCIPcopyParamSettings ( SCIP sourcescip,
SCIP targetscip 
)

copies parameter settings from sourcescip to targetscip

Note
In a multi thread case, you need to lock the copying procedure from outside with a mutex.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure

Definition at line 2564 of file scip_copy.c.

References FALSE, Scip::messagehdlr, NULL, SCIP_CALL, SCIP_OKAY, SCIPcheckStage(), SCIPsetCopyParams(), Scip::set, and TRUE.

Referenced by applyRepair(), createSubscip(), createSubSCIP(), doCopy(), SCIPcopyLargeNeighborhoodSearch(), setupSCIPparamsStage3(), and setupSubscipLpface().

◆ SCIPgetSubscipDepth()

int SCIPgetSubscipDepth ( SCIP scip)

◆ SCIPsetSubscipDepth()

void SCIPsetSubscipDepth ( SCIP scip,
int  newdepth 
)

sets depth of scip instance

Precondition
This method can be called if SCIP is in one of the following stages:
Note
SCIP stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
newdepthnew subscip depth

Definition at line 2626 of file scip_copy.c.

References FALSE, NULL, SCIP_CALL_ABORT, SCIPcheckStage(), Scip::stat, SCIP_Stat::subscipdepth, and TRUE.

Referenced by createCoveringProblem(), createSubscip(), and setupSubscipLpface().

◆ SCIPcopy()

SCIP_RETCODE SCIPcopy ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
const char *  suffix,
SCIP_Bool  global,
SCIP_Bool  enablepricing,
SCIP_Bool  threadsafe,
SCIP_Bool  passmessagehdlr,
SCIP_Bool valid 
)

copies source SCIP to target SCIP; the copying process is done in the following order: 1) copy the plugins 2) copy the settings 3) create problem data in target-SCIP and copy the problem data of the source-SCIP 4) copy all active variables except those are marked as relaxation-only 5) copy all constraints

The source problem depends on the stage of the sourcescip - In SCIP_STAGE_PROBLEM, the original problem is copied, otherwise, the transformed problem is copied. For an explicit copy of the original problem, use SCIPcopyOrig().

Note
all variables and constraints which are created in the target-SCIP are not (user) captured
In a multi thread case, you need to lock the copying procedure from outside with a mutex. Also, 'passmessagehdlr' should be set to FALSE.
the 'threadsafe' parameter should only be set to TRUE if you are absolutely certain that the source and target SCIP instances will be solved in parallel. The usual case is to set this to FALSE, since thread safety typically incurs a performance cost.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

copies source SCIP to target SCIP; the copying process is done in the following order: 1) copy the plugins 2) copy the settings 3) create problem data in target-SCIP and copy the problem data of the source-SCIP 4) copy all active variables except those that are marked as relaxation-only 5) copy all constraints

The source problem depends on the stage of the sourcescip - In SCIP_STAGE_PROBLEM, the original problem is copied, otherwise, the transformed problem is copied. For an explicit copy of the original problem, use SCIPcopyOrig().

Note
all variables and constraints which are created in the target-SCIP are not (user) captured
In a multi thread case, you need to lock the copying procedure from outside with a mutex. Also, 'passmessagehdlr' should be set to FALSE.
the 'threadsafe' parameter should only be set to TRUE if you are absolutely certain that the source and target SCIP instances will be solved in parallel. The usual case is to set this to FALSE, since thread safety typically incurs a performance cost.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
suffixoptional suffix for problem name inside the target SCIP
globalcreate a global or a local copy?
enablepricingshould pricing be enabled in copied SCIP instance? If TRUE, pricer plugins will be copied and activated, and the modifiable flag of constraints will be respected. If FALSE, valid will be set to FALSE, when there are pricers present
threadsafeFALSE, if data can be safely shared between the source and target SCIP, otherwise TRUE. This is usually set to FALSE
passmessagehdlrshould the message handler be passed
validpointer to store whether the copying was valid, or NULL

Definition at line 2875 of file scip_copy.c.

References doCopy(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcheckStage(), and TRUE.

Referenced by applyDomainChanges(), initConcsolver(), SCIP_DECL_HEUREXEC(), SCIP_DECL_RELAXEXEC(), setupAndSolveSubscip(), setupAndSolveSubscipOneopt(), and writeBounds().

◆ SCIPcopyConsCompression()

SCIP_RETCODE SCIPcopyConsCompression ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
const char *  suffix,
SCIP_VAR **  fixedvars,
SCIP_Real fixedvals,
int  nfixedvars,
SCIP_Bool  global,
SCIP_Bool  enablepricing,
SCIP_Bool  threadsafe,
SCIP_Bool  passmessagehdlr,
SCIP_Bool valid 
)

copies source SCIP to target SCIP but compresses constraints

constraint compression is performed by removing fixed variables immediately during constraint creation if the involved constraint handlers support compression

the copying process is done in the following order: 1) copy the plugins 2) copy the settings 3) create problem data in target-SCIP and copy the problem data of the source-SCIP 4) copy all active variables except those are marked as relaxation-only a) fix all variable copies specified by fixedvars, fixedvals, and nfixedvars b) enable constraint compression 5) copy all constraints

The source problem depends on the stage of the sourcescip - In SCIP_STAGE_PROBLEM, the original problem is copied, otherwise, the transformed problem is copied. For an explicit copy of the original problem, use SCIPcopyOrigConsCompression().

Note
: in case that a combination of local bounds and explicit fixing values should be used, the fixing value of a variable is preferred if local bounds and fixing value disagree.
all variables and constraints which are created in the target-SCIP are not (user) captured
In a multi thread case, you need to lock the copying procedure from outside with a mutex. Also, 'passmessagehdlr' should be set to FALSE.
the 'threadsafe' parameter should only be set to TRUE if you are absolutely certain that the source and target SCIP instances will be solved in parallel. The usual case is to set this to FALSE, since thread safety typically incurs a performance cost.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

copies source SCIP to target SCIP but compresses constraints

constraint compression is performed by removing fixed variables immediately during constraint creation if the involved constraint handlers support compression

the copying process is done in the following order: 1) copy the plugins 2) copy the settings 3) create problem data in target-SCIP and copy the problem data of the source-SCIP 4) copy all active variables except those that are marked as relaxation-only a) fix all variable copies specified by fixedvars, fixedvals, and nfixedvars b) enable constraint compression 5) copy all constraints

The source problem depends on the stage of the sourcescip - In SCIP_STAGE_PROBLEM, the original problem is copied, otherwise, the transformed problem is copied. For an explicit copy of the original problem, use SCIPcopyOrigConsCompression().

Note
: in case that a combination of local bounds and explicit fixing values should be used, the fixing value of a variable is preferred if local bounds and fixing value disagree.
all variables and constraints which are created in the target-SCIP are not (user) captured
In a multi thread case, you need to lock the copying procedure from outside with a mutex. Also, 'passmessagehdlr' should be set to FALSE.
the 'threadsafe' parameter should only be set to TRUE if you are absolutely certain that the source and target SCIP instances will be solved in parallel. The usual case is to set this to FALSE, since thread safety typically incurs a performance cost.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
suffixoptional suffix for problem name inside the target SCIP
fixedvarssource variables whose copies should be fixed in the target SCIP environment, or NULL
fixedvalsarray of fixing values for target SCIP variables, or NULL
nfixedvarsnumber of source variables whose copies should be fixed in the target SCIP environment, or NULL
globalcreate a global or a local copy?
enablepricingshould pricing be enabled in copied SCIP instance? If TRUE, pricer plugins will be copied and activated, and the modifiable flag of constraints will be respected. If FALSE, valid will be set to FALSE, when there are pricers present
threadsafeFALSE, if data can be safely shared between the source and target SCIP, otherwise TRUE. This is usually set to FALSE
passmessagehdlrshould the message handler be passed
validpointer to store whether the copying was valid, or NULL

Definition at line 2969 of file scip_copy.c.

References doCopy(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPcheckStage(), and TRUE.

Referenced by doSolveSubMIP(), reoptimize(), SCIPcopyLargeNeighborhoodSearch(), setupAndSolve(), setupAndSolveSubscip(), setupAndSolveSubscipRapidlearning(), setupProbingSCIP(), setupSubscipLpface(), and solveSubproblem().

◆ SCIPcopyOrig()

SCIP_RETCODE SCIPcopyOrig ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
const char *  suffix,
SCIP_Bool  enablepricing,
SCIP_Bool  threadsafe,
SCIP_Bool  passmessagehdlr,
SCIP_Bool valid 
)

copies source SCIP original problem to target SCIP; the copying process is done in the following order: 1) copy the plugins 2) copy the settings 3) create problem data in target-SCIP and copy the original problem data of the source-SCIP 4) copy all original variables 5) copy all original constraints

Note
all variables and constraints which are created in the target-SCIP are not (user) captured
In a multi thread case, you need to lock the copying procedure from outside with a mutex. Also, 'passmessagehdlr' should be set to FALSE.
the 'threadsafe' parameter should only be set to TRUE if you are absolutely certain that the source and target SCIP instances will be solved in parallel. The usual case is to set this to FALSE, since thread safety typically incurs a performance cost.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
suffixsuffix which will be added to the names of the target SCIP, might be empty
enablepricingshould pricing be enabled in copied SCIP instance? If TRUE, pricer plugins will be copied and activated, and the modifiable flag of constraints will be respected. If FALSE, valid will be set to FALSE, when there are pricers present
threadsafeFALSE, if data can be safely shared between the source and target SCIP, otherwise TRUE. This is usually set to FALSE
passmessagehdlrshould the message handler be passed
validpointer to store whether the copying was valid, or NULL

Definition at line 3050 of file scip_copy.c.

References doCopy(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcheckStage(), and TRUE.

Referenced by SCIP_DECL_BENDERSCOPY(), and setupAndSolveFiniteSolSubscip().

◆ SCIPcopyOrigConsCompression()

SCIP_RETCODE SCIPcopyOrigConsCompression ( SCIP sourcescip,
SCIP targetscip,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
const char *  suffix,
SCIP_VAR **  fixedvars,
SCIP_Real fixedvals,
int  nfixedvars,
SCIP_Bool  enablepricing,
SCIP_Bool  threadsafe,
SCIP_Bool  passmessagehdlr,
SCIP_Bool valid 
)

copies source SCIP original problem to target SCIP but compresses constraints

constraint compression is performed by removing fixed variables immediately during constraint creation if the involved constraint handlers support compression

the copying process is done in the following order: 1) copy the plugins 2) copy the settings 3) create problem data in target-SCIP and copy the problem data of the source-SCIP 4) copy all original variables a) fix all variable copies specified by fixedvars, fixedvals, and nfixedvars b) enable constraint compression 5) copy all constraints

Note
all variables and constraints which are created in the target-SCIP are not (user) captured
In a multi thread case, you need to lock the copying procedure from outside with a mutex. Also, 'passmessagehdlr' should be set to FALSE.
the 'threadsafe' parameter should only be set to TRUE if you are absolutely certain that the source and target SCIP instances will be solved in parallel. The usual case is to set this to FALSE, since thread safety typically incurs a performance cost.
Do not change the source SCIP environment during the copying process
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if sourcescip is in one of the following stages:
This method can be called if targetscip is in one of the following stages:
Note
sourcescip stage does not get changed
targetscip stage does not get changed

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure
varmapa hashmap to store the mapping of source variables corresponding target variables, or NULL
consmapa hashmap to store the mapping of source constraints to the corresponding target constraints, or NULL
suffixoptional suffix for problem name inside the target SCIP
fixedvarssource variables whose copies should be fixed in the target SCIP environment, or NULL
fixedvalsarray of fixing values for target SCIP variables, or NULL
nfixedvarsnumber of source variables whose copies should be fixed in the target SCIP environment, or NULL
enablepricingshould pricing be enabled in copied SCIP instance? If TRUE, pricer plugins will be copied and activated, and the modifiable flag of constraints will be respected. If FALSE, valid will be set to FALSE, when there are pricers present
threadsafeFALSE, if data can be safely shared between the source and target SCIP, otherwise TRUE. This is usually set to FALSE
passmessagehdlrshould the message handler be passed
validpointer to store whether the copying was valid, or NULL

Definition at line 3137 of file scip_copy.c.

References doCopy(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPcheckStage(), SCIPsyncstoreCapture(), SCIPsyncstoreRelease(), Scip::syncstore, and TRUE.

Referenced by reoptimize().

◆ SCIPcheckCopyLimits()

SCIP_RETCODE SCIPcheckCopyLimits ( SCIP sourcescip,
SCIP_Bool success 
)

checks if there is enough time and memory left for copying the sourcescip into a sub-SCIP and solve the sub-SCIP

This is the case if the time and memory limit that would be passed to the sub-SCIP are larger than 0.0

Precondition
This method can be called if sourcescip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
successpointer to store whether there is time and memory left to copy the problem and run the sub-SCIP

Definition at line 3253 of file scip_copy.c.

References getCopyMemlimit(), getCopyTimelimit(), SCIP_Set::misc_avoidmemout, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPgetMemExternEstim(), and Scip::set.

Referenced by applyCompletesol(), applyOfins(), applyVbounds(), determineLimits(), SCIP_DECL_HEUREXEC(), SCIPapplyProximity(), SCIPapplyRens(), SCIPapplyZeroobj(), solveSubMIP(), and solveSubscip().

◆ SCIPcopyLimits()

SCIP_RETCODE SCIPcopyLimits ( SCIP sourcescip,
SCIP targetscip 
)

copies limits from source SCIP to target SCIP

Note
time and memory limit are reduced by the amount already spent in the source SCIP before installing the limit in the target SCIP
all other limits are disabled and need to be enabled afterwards, if needed
See also
SCIPsetCommonSubscipParams() to set further working limits and other parameters commonly used for auxiliary problems
Precondition
This method can be called if sourcescip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

copies limits from source SCIP to target SCIP

Note
time and memory limit are reduced by the amount already spent in the source SCIP before installing the limit in the target SCIP
all other limits are disabled and need to be enabled afterwards, if needed
Precondition
This method can be called if sourcescip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
sourcescipsource SCIP data structure
targetsciptarget SCIP data structure

Definition at line 3296 of file scip_copy.c.

References copySofttimelimit(), getCopyMemlimit(), getCopyTimelimit(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPsetIntParam(), SCIPsetLongintParam(), and SCIPsetRealParam().

Referenced by createSubscip(), doSolveSubMIP(), reoptimize(), SCIP_DECL_HEUREXEC(), SCIPapplyProximity(), SCIPsetCommonSubscipParams(), setLimits(), setupAndSolve(), setupAndSolveSubscip(), setupAndSolveSubscipCrossover(), setupAndSolveSubscipMutation(), setupAndSolveSubscipOneopt(), setupAndSolveSubscipRapidlearning(), setupSCIPparamsStage3(), solveSubscip(), wrapperDins(), and wrapperRins().

◆ SCIPsetCommonSubscipParams()

SCIP_RETCODE SCIPsetCommonSubscipParams ( SCIP sourcescip,
SCIP subscip,
SCIP_Longint  nsubnodes,
SCIP_Longint  nstallnodes,
int  bestsollimit 
)

sets the working limits as well as common search parameters for the auxiliary problem

Note
memory and time limits are not affected, and must be set using SCIPcopyLimits() instead
Parameters
sourcescipsource SCIP data structure
subsciptarget SCIP data structure, often a copy of sourcescip
nsubnodesnodelimit for subscip, or -1 for no limit
nstallnodesstall node limit for subscip, or -1 for no limit
bestsollimitthe limit on the number of best solutions found, or -1 for no limit

Definition at line 3338 of file scip_copy.c.

References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_PARAMSETTING_FAST, SCIP_PARAMSETTING_OFF, SCIPcopyLimits(), SCIPfindBranchrule(), SCIPfindNodesel(), SCIPgetBoolParam(), SCIPisParamFixed(), SCIPsetBoolParam(), SCIPsetCharParam(), SCIPsetIntParam(), SCIPsetLongintParam(), SCIPsetPresolving(), SCIPsetSeparating(), SCIPsetSubscipsOff(), and TRUE.

Referenced by setupAndSolveSubscipLocalbranching(), and setupAndSolveSubscipTrustregion().