scip_copy.h
Go to the documentation of this file.
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
70 /** copies plugins from sourcescip to targetscip; in case that a constraint handler which does not need constraints
71 * cannot be copied, valid will return FALSE. All plugins can declare that, if their copy process failed, the
75 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
80 * @note This method does not copy Benders' plugins. To this end, the method SCIPcopyBenders() must be called
83 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
101 * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
136 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
138 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
156 * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
175 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
177 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
204 * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
218 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
226 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
228 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
246 * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
260 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
270 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
311 /** returns copy of the source variable; if there already is a copy of the source variable in the variable hash map,
312 * it is just returned as target variable; elsewise a new variable will be created and added to the target SCIP; this
315 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
317 * @note if a new variable was created, this variable will be added to the target-SCIP, but it is not captured
319 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
353 SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
355 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
361 /** copies all active variables from source-SCIP and adds these variable to the target-SCIP; the mapping between these
362 * variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed and aggregated
367 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
370 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
397 SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
399 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
401 SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
403 int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
407 /** copies all original variables from source-SCIP and adds these variable to the target-SCIP; the mapping between these
408 * variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed and aggregated
413 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
416 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
443 SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
445 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
447 SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
449 int nfixedvars /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
452 /** merges the histories of variables from a source SCIP into a target SCIP. The two data structures should point to
455 * @note the notion of source and target is inverted here; \p sourcescip usually denotes a copied SCIP instance, whereas
468 /** returns copy of the source constraint; if there already is a copy of the source constraint in the constraint hash
469 * map, it is just returned as target constraint; elsewise a new constraint will be created; this created constraint is
470 * added to the constraint hash map and returned as target constraint; the variable map is used to map the variables of
473 * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
474 * be declared feasible even if it violates this particular constraint. This constellation should only be
475 * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
478 * @note The constraint is not added to the target SCIP. You can check whether a constraint is added by calling
479 * SCIPconsIsAdded(). (If you mix SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add
482 * @note The constraint is always captured, either during the creation of the copy or after finding the copy of the
485 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
488 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
525 SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
527 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
529 const char* name, /**< name of constraint, or NULL if the name of the source constraint should be used */
538 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup? */
539 SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
546 * variables between the source and the target SCIP a hash map can be given; if the variable hash
547 * map is NULL or necessary variable mapping is missing, the required variables are created in the
548 * target-SCIP and added to the hash map, if not NULL; all variables which are created are added to
552 * @note the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix
553 * SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already
556 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
559 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
586 SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
588 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
596 /** copies all original constraints from the source-SCIP and adds these to the target-SCIP; for mapping the
597 * variables between the source and the target SCIP a hash map can be given; if the variable hash
598 * map is NULL or necessary variable mapping is missing, the required variables are created in the
599 * target-SCIP and added to the hash map, if not NULL; all variables which are created are added to
603 * @note the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix
604 * SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already
607 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
610 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
637 SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
639 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
650 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
671 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
679 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
682 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
717 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
723 /** copies all active conflicts from the conflict pool of sourcescip and adds them as linear constraints to targetscip
725 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
728 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
763 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
773 * This function should be called for a targetscip in transformed stage. It can save time in presolving of the
776 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
779 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
813 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
823 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
826 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
906 * The source problem depends on the stage of the \p sourcescip - In SCIP_STAGE_PROBLEM, the original problem is copied,
907 * otherwise, the transformed problem is copied. For an explicit copy of the original problem, use SCIPcopyOrig().
909 * @note all variables and constraints which are created in the target-SCIP are not (user) captured
911 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
915 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
945 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
949 SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
972 * The source problem depends on the stage of the \p sourcescip - In SCIP_STAGE_PROBLEM, the original problem is copied,
973 * otherwise, the transformed problem is copied. For an explicit copy of the original problem, use SCIPcopyOrigConsCompression().
978 * @note all variables and constraints which are created in the target-SCIP are not (user) captured
980 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
984 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1014 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1017 SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
1019 int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
1021 SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
1029 /** copies source SCIP original problem to target SCIP; the copying process is done in the following order:
1036 * @note all variables and constraints which are created in the target-SCIP are not (user) captured
1038 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1042 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1072 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1074 const char* suffix, /**< suffix which will be added to the names of the target SCIP, might be empty */
1075 SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
1098 * @note all variables and constraints which are created in the target-SCIP are not (user) captured
1100 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1104 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1134 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1137 SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
1139 int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
1140 SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
1148 /** checks if there is enough time and memory left for copying the sourcescip into a sub-SCIP and solve the sub-SCIP
1150 * This is the case if the time and memory limit that would be passed to the sub-SCIP are larger than 0.0
1174 * @note time and memory limit are reduced by the amount already spent in the source SCIP before installing the limit
SCIP_RETCODE SCIPcopyOrig(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool enablepricing, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip_copy.c:2780
internal methods for branch and bound tree
SCIP_RETCODE SCIPcopyOrigProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name)
Definition: scip_copy.c:610
type definitions for miscellaneous datastructures
Definition: struct_scip.h:58
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 copypropagators, SCIP_Bool copyheuristics, SCIP_Bool copyeventhdlrs, SCIP_Bool copynodeselectors, SCIP_Bool copybranchrules, SCIP_Bool copydisplays, SCIP_Bool copydialogs, SCIP_Bool copytables, SCIP_Bool copynlpis, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip_copy.c:316
Definition: struct_var.h:198
SCIP_RETCODE SCIPconvertCutsToConss(SCIP *scip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip_copy.c:1819
SCIP_RETCODE SCIPcopyLimits(SCIP *sourcescip, SCIP *targetscip)
Definition: scip_copy.c:3012
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 passmessagehdlr, SCIP_Bool *valid)
Definition: scip_copy.c:2704
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPcopyBenders(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_Bool *valid)
Definition: scip_copy.c:393
SCIP_RETCODE SCIPcopyParamSettings(SCIP *sourcescip, SCIP *targetscip)
Definition: scip_copy.c:2313
SCIP_RETCODE SCIPcopyOrigConss(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool enablepricing, SCIP_Bool *valid)
Definition: scip_copy.c:1686
SCIP_RETCODE SCIPenableConsCompression(SCIP *scip)
Definition: scip_copy.c:648
Definition: struct_misc.h:121
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 passmessagehdlr, SCIP_Bool *valid)
Definition: scip_copy.c:2862
Definition: struct_cons.h:37
Definition: struct_cons.h:117
type definitions for SCIP's main datastructure
SCIP_RETCODE SCIPcopyVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool global)
Definition: scip_copy.c:1158
SCIP_RETCODE SCIPcopyCuts(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip_copy.c:1879
SCIP_RETCODE SCIPmergeVariableStatistics(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR **sourcevars, SCIP_VAR **targetvars, int nvars)
Definition: scip_copy.c:1245
internal miscellaneous methods
SCIP_RETCODE SCIPcopyOrigVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars)
Definition: scip_copy.c:1215
internal methods for global SCIP settings
SCIP main data structure.
type definitions for problem variables
SCIP_RETCODE SCIPcopyImplicationsCliques(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *infeasible, int *nbdchgs, int *ncopied)
Definition: scip_copy.c:2129
SCIP_RETCODE SCIPcopyConflicts(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool *valid)
Definition: scip_copy.c:1971
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)
Definition: scip_copy.c:1350
internal methods for problem variables
SCIP_RETCODE SCIPcopyConss(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool *valid)
Definition: scip_copy.c:1486
methods for debugging
datastructures for problem statistics
SCIP_RETCODE SCIPcopyProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, const char *name)
Definition: scip_copy.c:557
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)
Definition: scip_copy.c:737
internal methods for main solving loop and node processing
SCIP_Bool SCIPisConsCompressionEnabled(SCIP *scip)
Definition: scip_copy.c:687
SCIP_RETCODE SCIPcopy(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip_copy.c:2615
internal methods for constraints and constraint handlers
SCIP_RETCODE SCIPcheckCopyLimits(SCIP *sourcescip, SCIP_Bool *success)
Definition: scip_copy.c:2976
common defines and data types used in all packages of SCIP
Definition: objbenders.h:33
type definitions for constraints and constraint handlers