scip_copy.h
Go to the documentation of this file.
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
51 /** copies plugins from sourcescip to targetscip; in case that a constraint handler which does not need constraints
52 * cannot be copied, valid will return FALSE. All plugins can declare that, if their copy process failed, the
56 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
61 * @note This method does not copy Benders' plugins. To this end, the method SCIPcopyBenders() must be called
64 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
82 * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
117 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
119 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
137 * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
156 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
158 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
185 * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
199 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
207 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
209 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
227 * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
241 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
251 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
292 /** returns copy of the source variable; if there already is a copy of the source variable in the variable hash map,
293 * it is just returned as target variable; elsewise a new variable will be created and added to the target SCIP; this
296 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
298 * @note if a new variable was created, this variable will be added to the target-SCIP, but it is not captured
300 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
334 SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
336 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
342 /** copies all active variables from source-SCIP and adds these variable to the target-SCIP; the mapping between these
343 * variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed and aggregated
348 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
351 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
378 SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
380 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
382 SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
384 int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
388 /** copies all original variables from source-SCIP and adds these variable to the target-SCIP; the mapping between these
389 * variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed and aggregated
394 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
397 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
424 SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
426 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
428 SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
430 int nfixedvars /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
433 /** merges the histories of variables from a source SCIP into a target SCIP. The two data structures should point to
436 * @note the notion of source and target is inverted here; \p sourcescip usually denotes a copied SCIP instance, whereas
449 /** returns copy of the source constraint; if there already is a copy of the source constraint in the constraint hash
450 * map, it is just returned as target constraint; elsewise a new constraint will be created; this created constraint is
451 * added to the constraint hash map and returned as target constraint; the variable map is used to map the variables of
454 * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
455 * be declared feasible even if it violates this particular constraint. This constellation should only be
456 * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
459 * @note The constraint is not added to the target SCIP. You can check whether a constraint is added by calling
460 * SCIPconsIsAdded(). (If you mix SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add
463 * @note The constraint is always captured, either during the creation of the copy or after finding the copy of the
466 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
469 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
506 SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
508 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
510 const char* name, /**< name of constraint, or NULL if the name of the source constraint should be used */
519 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup? */
520 SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
527 * variables between the source and the target SCIP a hash map can be given; if the variable hash
528 * map is NULL or necessary variable mapping is missing, the required variables are created in the
529 * target-SCIP and added to the hash map, if not NULL; all variables which are created are added to
533 * @note the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix
534 * SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already
537 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
540 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
567 SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
569 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
577 /** copies all original constraints from the source-SCIP and adds these to the target-SCIP; for mapping the
578 * variables between the source and the target SCIP a hash map can be given; if the variable hash
579 * map is NULL or necessary variable mapping is missing, the required variables are created in the
580 * target-SCIP and added to the hash map, if not NULL; all variables which are created are added to
584 * @note the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix
585 * SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already
588 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
591 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
618 SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
620 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
631 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
652 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
660 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
663 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
698 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
704 /** copies all active conflicts from the conflict pool of sourcescip and adds them as linear constraints to targetscip
706 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
709 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
744 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
754 * This function should be called for a targetscip in transformed stage. It can save time in presolving of the
757 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
760 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
794 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
804 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
807 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
887 * The source problem depends on the stage of the \p sourcescip - In SCIP_STAGE_PROBLEM, the original problem is copied,
888 * otherwise, the transformed problem is copied. For an explicit copy of the original problem, use SCIPcopyOrig().
890 * @note all variables and constraints which are created in the target-SCIP are not (user) captured
892 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
896 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
926 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
930 SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
953 * The source problem depends on the stage of the \p sourcescip - In SCIP_STAGE_PROBLEM, the original problem is copied,
954 * otherwise, the transformed problem is copied. For an explicit copy of the original problem, use SCIPcopyOrigConsCompression().
959 * @note all variables and constraints which are created in the target-SCIP are not (user) captured
961 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
965 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
995 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
998 SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
1000 int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
1002 SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
1010 /** copies source SCIP original problem to target SCIP; the copying process is done in the following order:
1017 * @note all variables and constraints which are created in the target-SCIP are not (user) captured
1019 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1023 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1053 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1055 const char* suffix, /**< suffix which will be added to the names of the target SCIP, might be empty */
1056 SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
1079 * @note all variables and constraints which are created in the target-SCIP are not (user) captured
1081 * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1085 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1115 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1118 SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
1120 int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
1121 SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
1129 /** checks if there is enough time and memory left for copying the sourcescip into a sub-SCIP and solve the sub-SCIP
1131 * This is the case if the time and memory limit that would be passed to the sub-SCIP are larger than 0.0
1155 * @note time and memory limit are reduced by the amount already spent in the source SCIP before installing the limit
SCIP_EXPORT 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:1421
type definitions for miscellaneous datastructures
Definition: struct_scip.h:58
SCIP_EXPORT SCIP_RETCODE SCIPcopyOrigConss(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool enablepricing, SCIP_Bool *valid)
Definition: scip_copy.c:1621
Definition: struct_var.h:198
SCIP_EXPORT 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:1285
type definitions for return codes for SCIP methods
SCIP_EXPORT SCIP_RETCODE SCIPcopyOrigProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name)
Definition: scip_copy.c:542
SCIP_EXPORT SCIP_RETCODE SCIPcheckCopyLimits(SCIP *sourcescip, SCIP_Bool *success)
Definition: scip_copy.c:2911
SCIP_EXPORT SCIP_RETCODE SCIPcopyProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, const char *name)
Definition: scip_copy.c:489
SCIP_EXPORT 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:2550
SCIP_EXPORT 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:672
Definition: struct_misc.h:127
SCIP_EXPORT SCIP_RETCODE SCIPcopyParamSettings(SCIP *sourcescip, SCIP *targetscip)
Definition: scip_copy.c:2248
Definition: struct_cons.h:37
SCIP_EXPORT SCIP_RETCODE SCIPcopyBenders(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_Bool *valid)
Definition: scip_copy.c:325
SCIP_EXPORT 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:2639
Definition: struct_cons.h:117
type definitions for SCIP's main datastructure
SCIP_EXPORT 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:2715
SCIP_EXPORT SCIP_RETCODE SCIPcopyCuts(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip_copy.c:1814
SCIP_EXPORT SCIP_RETCODE SCIPmergeVariableStatistics(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR **sourcevars, SCIP_VAR **targetvars, int nvars)
Definition: scip_copy.c:1180
SCIP_EXPORT SCIP_Bool SCIPisConsCompressionEnabled(SCIP *scip)
Definition: scip_copy.c:622
type definitions for problem variables
SCIP_EXPORT void SCIPsetSubscipDepth(SCIP *scip, int newdepth)
Definition: scip_copy.c:2310
SCIP_EXPORT SCIP_RETCODE SCIPcopyLimits(SCIP *sourcescip, SCIP *targetscip)
Definition: scip_copy.c:2947
SCIP_EXPORT 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:1093
SCIP_EXPORT SCIP_RETCODE SCIPenableConsCompression(SCIP *scip)
Definition: scip_copy.c:583
SCIP_EXPORT 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:1906
SCIP_EXPORT 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:1150
SCIP_EXPORT 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:248
SCIP_EXPORT 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:2797
SCIP_EXPORT 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:2064
common defines and data types used in all packages of SCIP
Definition: objbenders.h:33
SCIP_EXPORT SCIP_RETCODE SCIPconvertCutsToConss(SCIP *scip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip_copy.c:1754
type definitions for constraints and constraint handlers