Scippy

SCIP

Solving Constraint Integer Programs

scip_copy.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_copy.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for problem copies
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Thorsten Koch
22  * @author Alexander Martin
23  * @author Marc Pfetsch
24  * @author Kati Wolter
25  * @author Gregor Hendel
26  * @author Robert Lion Gottwald
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_SCIP_COPY_H__
32 #define __SCIP_SCIP_COPY_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_cons.h"
37 #include "scip/type_misc.h"
38 #include "scip/type_retcode.h"
39 #include "scip/type_scip.h"
40 #include "scip/type_var.h"
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /**@addtogroup CopyMethods
47  *
48  * @{
49  */
50 
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
53  * copied SCIP instance might not represent the same problem semantics as the original.
54  * Note that in this case dual reductions might be invalid.
55  *
56  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
57  * Also, 'passmessagehdlr' should be set to FALSE.
58  *
59  * @note Do not change the source SCIP environment during the copying process.
60  *
61  * @note This method does not copy Benders' plugins. To this end, the method SCIPcopyBenders() must be called
62  * separately.
63  *
64  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
65  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
66  *
67  * @pre This method can be called if sourcescip is in one of the following stages:
68  * - \ref SCIP_STAGE_PROBLEM
69  * - \ref SCIP_STAGE_TRANSFORMED
70  * - \ref SCIP_STAGE_INITPRESOLVE
71  * - \ref SCIP_STAGE_PRESOLVING
72  * - \ref SCIP_STAGE_EXITPRESOLVE
73  * - \ref SCIP_STAGE_PRESOLVED
74  * - \ref SCIP_STAGE_INITSOLVE
75  * - \ref SCIP_STAGE_SOLVING
76  * - \ref SCIP_STAGE_SOLVED
77  *
78  * @pre This method can be called if targetscip is in one of the following stages:
79  * - \ref SCIP_STAGE_INIT
80  * - \ref SCIP_STAGE_FREE
81  *
82  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
83  * process was interrupted:
84  * - \ref SCIP_STAGE_PROBLEM
85  *
86  * @note sourcescip stage does not get changed
87  *
88  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
89  */
92  SCIP* sourcescip, /**< source SCIP data structure */
93  SCIP* targetscip, /**< target SCIP data structure */
94  SCIP_Bool copyreaders, /**< should the file readers be copied */
95  SCIP_Bool copypricers, /**< should the variable pricers be copied */
96  SCIP_Bool copyconshdlrs, /**< should the constraint handlers be copied */
97  SCIP_Bool copyconflicthdlrs, /**< should the conflict handlers be copied */
98  SCIP_Bool copypresolvers, /**< should the presolvers be copied */
99  SCIP_Bool copyrelaxators, /**< should the relaxation handler be copied */
100  SCIP_Bool copyseparators, /**< should the separators be copied */
101  SCIP_Bool copypropagators, /**< should the propagators be copied */
102  SCIP_Bool copyheuristics, /**< should the heuristics be copied */
103  SCIP_Bool copyeventhdlrs, /**< should the event handlers be copied */
104  SCIP_Bool copynodeselectors, /**< should the node selectors be copied */
105  SCIP_Bool copybranchrules, /**< should the branchrules be copied */
106  SCIP_Bool copydisplays, /**< should the display columns be copied */
107  SCIP_Bool copydialogs, /**< should the dialogs be copied */
108  SCIP_Bool copytables, /**< should the statistics tables be copied */
109  SCIP_Bool copynlpis, /**< should the NLPIs be copied */
110  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
111  SCIP_Bool* valid /**< pointer to store whether plugins, in particular all constraint
112  * handlers which do not need constraints were validly copied */
113  );
114 
115 /** copies all Benders' decomposition plugins
116  *
117  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
118  *
119  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
120  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
121  *
122  * @pre This method can be called if sourcescip is in one of the following stages:
123  * - \ref SCIP_STAGE_PROBLEM
124  * - \ref SCIP_STAGE_TRANSFORMED
125  * - \ref SCIP_STAGE_INITPRESOLVE
126  * - \ref SCIP_STAGE_PRESOLVING
127  * - \ref SCIP_STAGE_EXITPRESOLVE
128  * - \ref SCIP_STAGE_PRESOLVED
129  * - \ref SCIP_STAGE_INITSOLVE
130  * - \ref SCIP_STAGE_SOLVING
131  * - \ref SCIP_STAGE_SOLVED
132  *
133  * @pre This method can be called if targetscip is in one of the following stages:
134  * - \ref SCIP_STAGE_INIT
135  * - \ref SCIP_STAGE_FREE
136  *
137  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
138  * process was interrupted:
139  * - \ref SCIP_STAGE_PROBLEM
140  *
141  * @note sourcescip stage does not get changed
142  *
143  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
144  */
147  SCIP* sourcescip, /**< source SCIP data structure */
148  SCIP* targetscip, /**< target SCIP data structure */
149  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
150  * target variables; must not be NULL */
151  SCIP_Bool* valid /**< pointer to store whether all plugins were validly copied */
152  );
153 
154 /** create a problem by copying the problem data of the source SCIP
155  *
156  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
157  * @note Do not change the source SCIP environment during the copying process
158  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
159  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
160  *
161  * @pre This method can be called if sourcescip is in one of the following stages:
162  * - \ref SCIP_STAGE_PROBLEM
163  * - \ref SCIP_STAGE_TRANSFORMED
164  * - \ref SCIP_STAGE_INITPRESOLVE
165  * - \ref SCIP_STAGE_PRESOLVING
166  * - \ref SCIP_STAGE_EXITPRESOLVE
167  * - \ref SCIP_STAGE_PRESOLVED
168  * - \ref SCIP_STAGE_INITSOLVE
169  * - \ref SCIP_STAGE_SOLVING
170  * - \ref SCIP_STAGE_SOLVED
171  *
172  * @pre This method can be called if targetscip is in one of the following stages:
173  * - \ref SCIP_STAGE_INIT
174  * - \ref SCIP_STAGE_PROBLEM
175  * - \ref SCIP_STAGE_TRANSFORMED
176  * - \ref SCIP_STAGE_INITPRESOLVE
177  * - \ref SCIP_STAGE_PRESOLVING
178  * - \ref SCIP_STAGE_EXITPRESOLVE
179  * - \ref SCIP_STAGE_PRESOLVED
180  * - \ref SCIP_STAGE_INITSOLVE
181  * - \ref SCIP_STAGE_SOLVING
182  * - \ref SCIP_STAGE_SOLVED
183  * - \ref SCIP_STAGE_FREE
184  *
185  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
186  * process was interrupted:
187  * - \ref SCIP_STAGE_PROBLEM
188  *
189  * @note sourcescip stage does not get changed
190  *
191  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
192  */
195  SCIP* sourcescip, /**< source SCIP data structure */
196  SCIP* targetscip, /**< target SCIP data structure */
197  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
198  * target variables, or NULL */
199  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
200  * target constraints, or NULL */
201  SCIP_Bool global, /**< create a global or a local copy? */
202  const char* name /**< problem name */
203  );
204 
205 /** create a problem by copying the original problem data of the source SCIP
206  *
207  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
208  * @note Do not change the source SCIP environment during the copying process
209  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
210  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
211  *
212  * @pre This method can be called if sourcescip is in one of the following stages:
213  * - \ref SCIP_STAGE_PROBLEM
214  * - \ref SCIP_STAGE_TRANSFORMED
215  * - \ref SCIP_STAGE_INITPRESOLVE
216  * - \ref SCIP_STAGE_PRESOLVING
217  * - \ref SCIP_STAGE_EXITPRESOLVE
218  * - \ref SCIP_STAGE_PRESOLVED
219  * - \ref SCIP_STAGE_INITSOLVE
220  * - \ref SCIP_STAGE_SOLVING
221  * - \ref SCIP_STAGE_SOLVED
222  *
223  * @pre This method can be called if targetscip is in one of the following stages:
224  * - \ref SCIP_STAGE_INIT
225  * - \ref SCIP_STAGE_FREE
226  *
227  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
228  * process was interrupted:
229  * - \ref SCIP_STAGE_PROBLEM
230  *
231  * @note sourcescip stage does not get changed
232  *
233  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
234  */
237  SCIP* sourcescip, /**< source SCIP data structure */
238  SCIP* targetscip, /**< target SCIP data structure */
239  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
240  * target variables, or NULL */
241  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
242  * target constraints, or NULL */
243  const char* name /**< problem name of target */
244  );
245 
246 /** enables constraint compression.
247  *
248  * If constraint compression is enabled, fixed variables will be treated as constants
249  * by all constraints that are copied after calling this method.
250  *
251  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
252  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
253  *
254  * @pre This method can be called if scip is in one of the following stages:
255  * - \ref SCIP_STAGE_PROBLEM
256  *
257  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
258  */
261  SCIP* scip /**< source SCIP data structure */
262  );
263 
264 /** is constraint compression enabled?
265  *
266  * If constraint compression is enabled, fixed variables can be treated as constants
267  * by all constraints that are copied after calling this method.
268  *
269  * @return TRUE if problem constraint compression is enabled, otherwise FALSE
270  *
271  * @pre This method can be called if scip is in one of the following stages:
272  * - \ref SCIP_STAGE_PROBLEM
273  * - \ref SCIP_STAGE_TRANSFORMING
274  * - \ref SCIP_STAGE_TRANSFORMED
275  * - \ref SCIP_STAGE_INITPRESOLVE
276  * - \ref SCIP_STAGE_PRESOLVING
277  * - \ref SCIP_STAGE_EXITPRESOLVE
278  * - \ref SCIP_STAGE_PRESOLVED
279  * - \ref SCIP_STAGE_INITSOLVE
280  * - \ref SCIP_STAGE_SOLVING
281  * - \ref SCIP_STAGE_SOLVED
282  * - \ref SCIP_STAGE_EXITSOLVE
283  * - \ref SCIP_STAGE_FREETRANS
284  *
285  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
286  */
289  SCIP* scip /**< source SCIP data structure */
290  );
291 
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
294  * created variable is added to the variable hash map and returned as target variable
295  *
296  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
297  * @note Do not change the source SCIP environment during the copying process
298  * @note if a new variable was created, this variable will be added to the target-SCIP, but it is not captured
299  *
300  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
301  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
302  *
303  * @pre This method can be called if sourcescip is in one of the following stages:
304  * - \ref SCIP_STAGE_PROBLEM
305  * - \ref SCIP_STAGE_TRANSFORMED
306  * - \ref SCIP_STAGE_INITPRESOLVE
307  * - \ref SCIP_STAGE_PRESOLVING
308  * - \ref SCIP_STAGE_EXITPRESOLVE
309  * - \ref SCIP_STAGE_PRESOLVED
310  * - \ref SCIP_STAGE_INITSOLVE
311  * - \ref SCIP_STAGE_SOLVING
312  * - \ref SCIP_STAGE_SOLVED
313  *
314  * @pre This method can be called if targetscip is in one of the following stages:
315  * - \ref SCIP_STAGE_PROBLEM
316  * - \ref SCIP_STAGE_TRANSFORMED
317  * - \ref SCIP_STAGE_INITPRESOLVE
318  * - \ref SCIP_STAGE_PRESOLVING
319  * - \ref SCIP_STAGE_EXITPRESOLVE
320  * - \ref SCIP_STAGE_SOLVING
321  *
322  * @note targetscip stage does not get changed
323  *
324  * @note sourcescip stage does not get changed
325  *
326  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
327  */
330  SCIP* sourcescip, /**< source SCIP data structure */
331  SCIP* targetscip, /**< target SCIP data structure */
332  SCIP_VAR* sourcevar, /**< source variable */
333  SCIP_VAR** targetvar, /**< pointer to store the target variable */
334  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
335  * target variables, or NULL */
336  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
337  * target constraints, or NULL */
338  SCIP_Bool global, /**< should global or local bounds be used? */
339  SCIP_Bool* success /**< pointer to store whether the copying was successful or not */
340  );
341 
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
344  * variables do not get copied
345  *
346  * @note the variables are added to the target-SCIP but not captured
347  *
348  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
349  * @note Do not change the source SCIP environment during the copying process
350  *
351  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
352  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
353  *
354  * @pre This method can be called if sourcescip is in one of the following stages:
355  * - \ref SCIP_STAGE_PROBLEM
356  * - \ref SCIP_STAGE_TRANSFORMED
357  * - \ref SCIP_STAGE_INITPRESOLVE
358  * - \ref SCIP_STAGE_PRESOLVING
359  * - \ref SCIP_STAGE_EXITPRESOLVE
360  * - \ref SCIP_STAGE_PRESOLVED
361  * - \ref SCIP_STAGE_INITSOLVE
362  * - \ref SCIP_STAGE_SOLVING
363  * - \ref SCIP_STAGE_SOLVED
364  *
365  * @pre This method can be called if targetscip is in one of the following stages:
366  * - \ref SCIP_STAGE_PROBLEM
367  *
368  * @note sourcescip stage does not get changed
369  *
370  * @note targetscip stage does not get changed
371  *
372  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
373  */
376  SCIP* sourcescip, /**< source SCIP data structure */
377  SCIP* targetscip, /**< target SCIP data structure */
378  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
379  * target variables, or NULL */
380  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
381  * target constraints, or NULL */
382  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
383  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
384  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
385  SCIP_Bool global /**< should global or local bounds be used? */
386  );
387 
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
390  * variables do not get copied
391  *
392  * @note the variables are added to the target-SCIP but not captured
393  *
394  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
395  * @note Do not change the source SCIP environment during the copying process
396  *
397  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
398  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
399  *
400  * @pre This method can be called if sourcescip is in one of the following stages:
401  * - \ref SCIP_STAGE_PROBLEM
402  * - \ref SCIP_STAGE_TRANSFORMED
403  * - \ref SCIP_STAGE_INITPRESOLVE
404  * - \ref SCIP_STAGE_PRESOLVING
405  * - \ref SCIP_STAGE_EXITPRESOLVE
406  * - \ref SCIP_STAGE_PRESOLVED
407  * - \ref SCIP_STAGE_INITSOLVE
408  * - \ref SCIP_STAGE_SOLVING
409  * - \ref SCIP_STAGE_SOLVED
410  *
411  * @pre This method can be called if targetscip is in one of the following stages:
412  * - \ref SCIP_STAGE_PROBLEM
413  *
414  * @note sourcescip stage does not get changed
415  *
416  * @note targetscip stage does not get changed
417  *
418  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
419  */
422  SCIP* sourcescip, /**< source SCIP data structure */
423  SCIP* targetscip, /**< target SCIP data structure */
424  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
425  * target variables, or NULL */
426  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
427  * target constraints, or NULL */
428  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
429  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
430  int nfixedvars /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
431  );
432 
433 /** merges the histories of variables from a source SCIP into a target SCIP. The two data structures should point to
434  * different SCIP instances.
435  *
436  * @note the notion of source and target is inverted here; \p sourcescip usually denotes a copied SCIP instance, whereas
437  * \p targetscip denotes the original instance
438  */
439 
442  SCIP* sourcescip, /**< source SCIP data structure */
443  SCIP* targetscip, /**< target SCIP data structure */
444  SCIP_VAR** sourcevars, /**< source variables for history merge */
445  SCIP_VAR** targetvars, /**< target variables for history merge */
446  int nvars /**< number of variables in both variable arrays */
447  );
448 
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
452  * the source SCIP to the variables of the target SCIP
453  *
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
457  * to the variable's local bounds.
458  *
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
461  * explicitly and what is already added.)
462  *
463  * @note The constraint is always captured, either during the creation of the copy or after finding the copy of the
464  * constraint in the constraint hash map
465  *
466  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
467  * @note Do not change the source SCIP environment during the copying process
468  *
469  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
470  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
471  *
472  * @pre This method can be called if sourcescip is in one of the following stages:
473  * - \ref SCIP_STAGE_PROBLEM
474  * - \ref SCIP_STAGE_TRANSFORMED
475  * - \ref SCIP_STAGE_INITPRESOLVE
476  * - \ref SCIP_STAGE_PRESOLVING
477  * - \ref SCIP_STAGE_EXITPRESOLVE
478  * - \ref SCIP_STAGE_PRESOLVED
479  * - \ref SCIP_STAGE_INITSOLVE
480  * - \ref SCIP_STAGE_SOLVING
481  * - \ref SCIP_STAGE_SOLVED
482  *
483  * @pre This method can be called if targetscip is in one of the following stages:
484  * - \ref SCIP_STAGE_PROBLEM
485  * - \ref SCIP_STAGE_TRANSFORMING
486  * - \ref SCIP_STAGE_INITPRESOLVE
487  * - \ref SCIP_STAGE_PRESOLVING
488  * - \ref SCIP_STAGE_EXITPRESOLVE
489  * - \ref SCIP_STAGE_PRESOLVED
490  * - \ref SCIP_STAGE_SOLVING
491  * - \ref SCIP_STAGE_EXITSOLVE
492  *
493  * @note sourcescip stage does not get changed
494  *
495  * @note targetscip stage does not get changed
496  *
497  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
498  */
501  SCIP* sourcescip, /**< source SCIP data structure */
502  SCIP* targetscip, /**< target SCIP data structure */
503  SCIP_CONS* sourcecons, /**< source constraint of the source SCIP */
504  SCIP_CONS** targetcons, /**< pointer to store the created target constraint */
505  SCIP_CONSHDLR* sourceconshdlr, /**< source constraint handler for this constraint */
506  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
507  * variables of the target SCIP, or NULL */
508  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
509  * target constraints, or NULL */
510  const char* name, /**< name of constraint, or NULL if the name of the source constraint should be used */
511  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP? */
512  SCIP_Bool separate, /**< should the constraint be separated during LP processing? */
513  SCIP_Bool enforce, /**< should the constraint be enforced during node processing? */
514  SCIP_Bool check, /**< should the constraint be checked for feasibility? */
515  SCIP_Bool propagate, /**< should the constraint be propagated during node processing? */
516  SCIP_Bool local, /**< is constraint only valid locally? */
517  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)? */
518  SCIP_Bool dynamic, /**< is constraint subject to aging? */
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
521  * if it may be moved to a more global node? */
522  SCIP_Bool global, /**< create a global or a local copy? */
523  SCIP_Bool* valid /**< pointer to store whether the copying was valid or not */
524  );
525 
526 /** copies constraints from the source-SCIP and adds these to the target-SCIP; for mapping the
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
530  * the target-SCIP but not (user) captured; if the constraint hash map is not NULL the mapping
531  * between the constraints of the source and target-SCIP is stored
532  *
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
535  * added.) You can check whether a constraint is added by calling SCIPconsIsAdded().
536  *
537  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
538  * @note Do not change the source SCIP environment during the copying process
539  *
540  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
541  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
542  *
543  * @pre This method can be called if sourcescip is in one of the following stages:
544  * - \ref SCIP_STAGE_PROBLEM
545  * - \ref SCIP_STAGE_TRANSFORMED
546  * - \ref SCIP_STAGE_INITPRESOLVE
547  * - \ref SCIP_STAGE_PRESOLVING
548  * - \ref SCIP_STAGE_EXITPRESOLVE
549  * - \ref SCIP_STAGE_PRESOLVED
550  * - \ref SCIP_STAGE_INITSOLVE
551  * - \ref SCIP_STAGE_SOLVING
552  * - \ref SCIP_STAGE_SOLVED
553  *
554  * @pre This method can be called if targetscip is in one of the following stages:
555  * - \ref SCIP_STAGE_PROBLEM
556  *
557  * @note sourcescip stage does not get changed
558  *
559  * @note targetscip stage does not get changed
560  *
561  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
562  */
565  SCIP* sourcescip, /**< source SCIP data structure */
566  SCIP* targetscip, /**< target SCIP data structure */
567  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
568  * variables of the target SCIP, or NULL */
569  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
570  * target constraints, or NULL */
571  SCIP_Bool global, /**< create a global or a local copy? */
572  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance?
573  * If TRUE, the modifiable flag of constraints will be copied. */
574  SCIP_Bool* valid /**< pointer to store whether all constraints were validly copied */
575  );
576 
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
581  * the target-SCIP but not (user) captured; if the constraint hash map is not NULL the mapping
582  * between the constraints of the source and target-SCIP is stored
583  *
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
586  * added.) You can check whether a constraint is added by calling SCIPconsIsAdded().
587  *
588  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
589  * @note Do not change the source SCIP environment during the copying process
590  *
591  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
592  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
593  *
594  * @pre This method can be called if sourcescip is in one of the following stages:
595  * - \ref SCIP_STAGE_PROBLEM
596  * - \ref SCIP_STAGE_TRANSFORMED
597  * - \ref SCIP_STAGE_INITPRESOLVE
598  * - \ref SCIP_STAGE_PRESOLVING
599  * - \ref SCIP_STAGE_EXITPRESOLVE
600  * - \ref SCIP_STAGE_PRESOLVED
601  * - \ref SCIP_STAGE_INITSOLVE
602  * - \ref SCIP_STAGE_SOLVING
603  * - \ref SCIP_STAGE_SOLVED
604  *
605  * @pre This method can be called if targetscip is in one of the following stages:
606  * - \ref SCIP_STAGE_PROBLEM
607  *
608  * @note sourcescip stage does not get changed
609  *
610  * @note targetscip stage does not get changed
611  *
612  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
613  */
616  SCIP* sourcescip, /**< source SCIP data structure */
617  SCIP* targetscip, /**< target SCIP data structure */
618  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
619  * variables of the target SCIP, or NULL */
620  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
621  * target constraints, or NULL */
622  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance?
623  * If TRUE, the modifiable flag of constraints will be copied. */
624  SCIP_Bool* valid /**< pointer to store whether all constraints were validly copied */
625  );
626 
627 /** convert all active cuts from cutpool to linear constraints
628  *
629  * @note Do not change the source SCIP environment during the copying process
630  *
631  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
632  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
633  *
634  * @pre This method can be called if SCIP is in one of the following stages:
635  * - \ref SCIP_STAGE_PROBLEM
636  * - \ref SCIP_STAGE_INITPRESOLVE
637  * - \ref SCIP_STAGE_PRESOLVING
638  * - \ref SCIP_STAGE_EXITPRESOLVE
639  * - \ref SCIP_STAGE_PRESOLVED
640  * - \ref SCIP_STAGE_SOLVING
641  * - \ref SCIP_STAGE_EXITSOLVE
642  *
643  * @note SCIP stage does not get changed
644  *
645  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
646  */
649  SCIP* scip, /**< SCIP data structure */
650  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
651  * target variables, or NULL */
652  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
653  * target constraints, or NULL */
654  SCIP_Bool global, /**< create a global or a local copy? */
655  int* ncutsadded /**< pointer to store number of added cuts, or NULL */
656  );
657 
658 /** copies all active cuts from cutpool of sourcescip to linear constraints in targetscip
659  *
660  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
661  * @note Do not change the source SCIP environment during the copying process
662  *
663  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
664  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
665  *
666  * @pre This method can be called if sourcescip is in one of the following stages:
667  * - \ref SCIP_STAGE_PROBLEM
668  * - \ref SCIP_STAGE_TRANSFORMED
669  * - \ref SCIP_STAGE_INITPRESOLVE
670  * - \ref SCIP_STAGE_PRESOLVING
671  * - \ref SCIP_STAGE_EXITPRESOLVE
672  * - \ref SCIP_STAGE_PRESOLVED
673  * - \ref SCIP_STAGE_SOLVING
674  * - \ref SCIP_STAGE_SOLVED
675  * - \ref SCIP_STAGE_EXITSOLVE
676  *
677  * @pre This method can be called if targetscip is in one of the following stages:
678  * - \ref SCIP_STAGE_PROBLEM
679  * - \ref SCIP_STAGE_INITPRESOLVE
680  * - \ref SCIP_STAGE_PRESOLVING
681  * - \ref SCIP_STAGE_EXITPRESOLVE
682  * - \ref SCIP_STAGE_PRESOLVED
683  * - \ref SCIP_STAGE_SOLVING
684  * - \ref SCIP_STAGE_EXITSOLVE
685  *
686  * @note sourcescip stage does not get changed
687  *
688  * @note targetscip stage does not get changed
689  *
690  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
691  */
694  SCIP* sourcescip, /**< source SCIP data structure */
695  SCIP* targetscip, /**< target SCIP data structure */
696  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
697  * target variables, or NULL */
698  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
699  * target constraints, or NULL */
700  SCIP_Bool global, /**< create a global or a local copy? */
701  int* ncutsadded /**< pointer to store number of copied cuts, or NULL */
702  );
703 
704 /** copies all active conflicts from the conflict pool of sourcescip and adds them as linear constraints to targetscip
705  *
706  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
707  * @note Do not change the source SCIP environment during the copying process
708  *
709  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
710  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
711  *
712  * @pre This method can be called if sourcescip is in one of the following stages:
713  * - \ref SCIP_STAGE_PROBLEM
714  * - \ref SCIP_STAGE_TRANSFORMED
715  * - \ref SCIP_STAGE_INITPRESOLVE
716  * - \ref SCIP_STAGE_PRESOLVING
717  * - \ref SCIP_STAGE_EXITPRESOLVE
718  * - \ref SCIP_STAGE_PRESOLVED
719  * - \ref SCIP_STAGE_SOLVING
720  * - \ref SCIP_STAGE_SOLVED
721  * - \ref SCIP_STAGE_EXITSOLVE
722  *
723  * @pre This method can be called if targetscip is in one of the following stages:
724  * - \ref SCIP_STAGE_PROBLEM
725  * - \ref SCIP_STAGE_INITPRESOLVE
726  * - \ref SCIP_STAGE_PRESOLVING
727  * - \ref SCIP_STAGE_EXITPRESOLVE
728  * - \ref SCIP_STAGE_PRESOLVED
729  * - \ref SCIP_STAGE_SOLVING
730  * - \ref SCIP_STAGE_EXITSOLVE
731  *
732  * @note sourcescip stage does not change
733  *
734  * @note targetscip stage does not change
735  *
736  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
737  */
740  SCIP* sourcescip, /**< source SCIP data structure */
741  SCIP* targetscip, /**< target SCIP data structure */
742  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
743  * target variables, or NULL */
744  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
745  * target constraints, or NULL */
746  SCIP_Bool global, /**< create a global or a local copy? */
747  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance?
748  * If TRUE, the modifiable flag of constraints will be copied. */
749  SCIP_Bool* valid /**< pointer to store whether all constraints were validly copied */
750  );
751 
752 /** copies implications and cliques of sourcescip to targetscip
753  *
754  * This function should be called for a targetscip in transformed stage. It can save time in presolving of the
755  * targetscip, since implications and cliques are copied.
756  *
757  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
758  * @note Do not change the source SCIP environment during the copying process
759  *
760  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
761  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
762  *
763  * @pre This method can be called if sourcescip is in one of the following stages:
764  * - \ref SCIP_STAGE_TRANSFORMED
765  * - \ref SCIP_STAGE_INITPRESOLVE
766  * - \ref SCIP_STAGE_PRESOLVING
767  * - \ref SCIP_STAGE_EXITPRESOLVE
768  * - \ref SCIP_STAGE_PRESOLVED
769  * - \ref SCIP_STAGE_SOLVING
770  * - \ref SCIP_STAGE_SOLVED
771  * - \ref SCIP_STAGE_EXITSOLVE
772  *
773  * @pre This method can be called if targetscip is in one of the following stages:
774  * - \ref SCIP_STAGE_TRANSFORMED
775  * - \ref SCIP_STAGE_INITPRESOLVE
776  * - \ref SCIP_STAGE_PRESOLVING
777  * - \ref SCIP_STAGE_EXITPRESOLVE
778  * - \ref SCIP_STAGE_PRESOLVED
779  * - \ref SCIP_STAGE_INITSOLVE
780  * - \ref SCIP_STAGE_SOLVING
781  *
782  * @note sourcescip stage does not get changed
783  *
784  * @note targetscip stage does not get changed
785  *
786  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
787  */
790  SCIP* sourcescip, /**< source SCIP data structure */
791  SCIP* targetscip, /**< target SCIP data structure */
792  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
793  * target variables, or NULL */
794  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
795  * target constraints, or NULL */
796  SCIP_Bool global, /**< create a global or a local copy? */
797  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
798  int* nbdchgs, /**< pointer to store the number of performed bound changes, or NULL */
799  int* ncopied /**< pointer to store number of copied implications and cliques, or NULL */
800  );
801 
802 /** copies parameter settings from sourcescip to targetscip
803  *
804  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
805  * @note Do not change the source SCIP environment during the copying process
806  *
807  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
808  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
809  *
810  * @pre This method can be called if sourcescip is in one of the following stages:
811  * - \ref SCIP_STAGE_PROBLEM
812  * - \ref SCIP_STAGE_TRANSFORMED
813  * - \ref SCIP_STAGE_INITPRESOLVE
814  * - \ref SCIP_STAGE_PRESOLVING
815  * - \ref SCIP_STAGE_EXITPRESOLVE
816  * - \ref SCIP_STAGE_PRESOLVED
817  * - \ref SCIP_STAGE_INITSOLVE
818  * - \ref SCIP_STAGE_SOLVING
819  * - \ref SCIP_STAGE_SOLVED
820  *
821  * @pre This method can be called if targetscip is in one of the following stages:
822  * - \ref SCIP_STAGE_INIT
823  * - \ref SCIP_STAGE_PROBLEM
824  * - \ref SCIP_STAGE_FREE
825  *
826  * @note sourcescip stage does not get changed
827  *
828  * @note targetscip stage does not get changed
829  *
830  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
831  */
834  SCIP* sourcescip, /**< source SCIP data structure */
835  SCIP* targetscip /**< target SCIP data structure */
836  );
837 
838 /** gets depth of current scip instance (increased by each copy call)
839  *
840  * @return Depth of subscip of SCIP is returned.
841  *
842  * @pre This method can be called if SCIP is in one of the following stages:
843  * - \ref SCIP_STAGE_PROBLEM
844  * - \ref SCIP_STAGE_TRANSFORMING
845  * - \ref SCIP_STAGE_TRANSFORMED
846  * - \ref SCIP_STAGE_INITPRESOLVE
847  * - \ref SCIP_STAGE_PRESOLVING
848  * - \ref SCIP_STAGE_EXITPRESOLVE
849  * - \ref SCIP_STAGE_PRESOLVED
850  * - \ref SCIP_STAGE_INITSOLVE
851  * - \ref SCIP_STAGE_SOLVING
852  * - \ref SCIP_STAGE_SOLVED
853  * - \ref SCIP_STAGE_EXITSOLVE
854  * - \ref SCIP_STAGE_FREETRANS
855  *
856  * @note SCIP stage does not get changed
857  *
858  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
859  */
862  SCIP* scip /**< SCIP data structure */
863  );
864 
865 /** sets depth of scip instance
866  *
867  * @pre This method can be called if SCIP is in one of the following stages:
868  * - \ref SCIP_STAGE_PROBLEM
869  *
870  * @note SCIP stage does not get changed
871  *
872  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
873  */
876  SCIP* scip, /**< SCIP data structure */
877  int newdepth /**< new subscip depth */
878  );
879 
880 /** copies source SCIP to target SCIP; the copying process is done in the following order:
881  * 1) copy the plugins
882  * 2) copy the settings
883  * 3) create problem data in target-SCIP and copy the problem data of the source-SCIP
884  * 4) copy all active variables
885  * 5) copy all constraints
886  *
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().
889  *
890  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
891  *
892  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
893  * Also, 'passmessagehdlr' should be set to FALSE.
894  * @note Do not change the source SCIP environment during the copying process
895  *
896  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
897  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
898  *
899  * @pre This method can be called if sourcescip is in one of the following stages:
900  * - \ref SCIP_STAGE_PROBLEM
901  * - \ref SCIP_STAGE_TRANSFORMED
902  * - \ref SCIP_STAGE_INITPRESOLVE
903  * - \ref SCIP_STAGE_PRESOLVING
904  * - \ref SCIP_STAGE_EXITPRESOLVE
905  * - \ref SCIP_STAGE_PRESOLVED
906  * - \ref SCIP_STAGE_INITSOLVE
907  * - \ref SCIP_STAGE_SOLVING
908  * - \ref SCIP_STAGE_SOLVED
909  *
910  * @pre This method can be called if targetscip is in one of the following stages:
911  * - \ref SCIP_STAGE_INIT
912  * - \ref SCIP_STAGE_FREE
913  *
914  * @note sourcescip stage does not get changed
915  *
916  * @note targetscip stage does not get changed
917  *
918  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
919  */
922  SCIP* sourcescip, /**< source SCIP data structure */
923  SCIP* targetscip, /**< target SCIP data structure */
924  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
925  * target variables, or NULL */
926  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
927  * target constraints, or NULL */
928  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
929  SCIP_Bool global, /**< create a global or a local copy? */
930  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
931  * plugins will be copied and activated, and the modifiable flag of
932  * constraints will be respected. If FALSE, valid will be set to FALSE, when
933  * there are pricers present */
934  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
935  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
936  );
937 
938 /** copies source SCIP to target SCIP but compresses constraints
939  *
940  * constraint compression is performed by removing fixed variables immediately
941  * during constraint creation if the involved constraint handlers support
942  * compression
943  *
944  * the copying process is done in the following order:
945  * 1) copy the plugins
946  * 2) copy the settings
947  * 3) create problem data in target-SCIP and copy the problem data of the source-SCIP
948  * 4) copy all active variables
949  * a) fix all variable copies specified by \p fixedvars, \p fixedvals, and \p nfixedvars
950  * b) enable constraint compression
951  * 5) copy all constraints
952  *
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().
955  *
956  * @note: in case that a combination of local bounds and explicit fixing values should be used,
957  * the fixing value of a variable is preferred if local bounds and fixing value disagree.
958  *
959  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
960  *
961  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
962  * Also, 'passmessagehdlr' should be set to FALSE.
963  * @note Do not change the source SCIP environment during the copying process
964  *
965  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
966  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
967  *
968  * @pre This method can be called if sourcescip is in one of the following stages:
969  * - \ref SCIP_STAGE_PROBLEM
970  * - \ref SCIP_STAGE_TRANSFORMED
971  * - \ref SCIP_STAGE_INITPRESOLVE
972  * - \ref SCIP_STAGE_PRESOLVING
973  * - \ref SCIP_STAGE_EXITPRESOLVE
974  * - \ref SCIP_STAGE_PRESOLVED
975  * - \ref SCIP_STAGE_INITSOLVE
976  * - \ref SCIP_STAGE_SOLVING
977  * - \ref SCIP_STAGE_SOLVED
978  *
979  * @pre This method can be called if targetscip is in one of the following stages:
980  * - \ref SCIP_STAGE_INIT
981  * - \ref SCIP_STAGE_FREE
982  *
983  * @note sourcescip stage does not get changed
984  *
985  * @note targetscip stage does not get changed
986  *
987  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
988  */
991  SCIP* sourcescip, /**< source SCIP data structure */
992  SCIP* targetscip, /**< target SCIP data structure */
993  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
994  * target variables, or NULL */
995  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
996  * target constraints, or NULL */
997  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
998  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
999  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
1000  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
1001  SCIP_Bool global, /**< create a global or a local copy? */
1002  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
1003  * plugins will be copied and activated, and the modifiable flag of
1004  * constraints will be respected. If FALSE, valid will be set to FALSE, when
1005  * there are pricers present */
1006  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
1007  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
1008  );
1009 
1010 /** copies source SCIP original problem to target SCIP; the copying process is done in the following order:
1011  * 1) copy the plugins
1012  * 2) copy the settings
1013  * 3) create problem data in target-SCIP and copy the original problem data of the source-SCIP
1014  * 4) copy all original variables
1015  * 5) copy all original constraints
1016  *
1017  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
1018  *
1019  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1020  * Also, 'passmessagehdlr' should be set to FALSE.
1021  * @note Do not change the source SCIP environment during the copying process
1022  *
1023  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1024  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1025  *
1026  * @pre This method can be called if sourcescip is in one of the following stages:
1027  * - \ref SCIP_STAGE_PROBLEM
1028  * - \ref SCIP_STAGE_TRANSFORMED
1029  * - \ref SCIP_STAGE_INITPRESOLVE
1030  * - \ref SCIP_STAGE_PRESOLVING
1031  * - \ref SCIP_STAGE_EXITPRESOLVE
1032  * - \ref SCIP_STAGE_PRESOLVED
1033  * - \ref SCIP_STAGE_INITSOLVE
1034  * - \ref SCIP_STAGE_SOLVING
1035  * - \ref SCIP_STAGE_SOLVED
1036  *
1037  * @pre This method can be called if targetscip is in one of the following stages:
1038  * - \ref SCIP_STAGE_INIT
1039  * - \ref SCIP_STAGE_FREE
1040  *
1041  * @note sourcescip stage does not get changed
1042  *
1043  * @note targetscip stage does not get changed
1044  *
1045  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1046  */
1049  SCIP* sourcescip, /**< source SCIP data structure */
1050  SCIP* targetscip, /**< target SCIP data structure */
1051  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1052  * target variables, or NULL */
1053  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1054  * target constraints, or NULL */
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
1057  * plugins will be copied and activated, and the modifiable flag of
1058  * constraints will be respected. If FALSE, valid will be set to FALSE, when
1059  * there are pricers present */
1060  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
1061  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
1062  );
1063 
1064 /** copies source SCIP original problem to target SCIP but compresses constraints
1065  *
1066  * constraint compression is performed by removing fixed variables immediately
1067  * during constraint creation if the involved constraint handlers support
1068  * compression
1069  *
1070  * the copying process is done in the following order:
1071  * 1) copy the plugins
1072  * 2) copy the settings
1073  * 3) create problem data in target-SCIP and copy the problem data of the source-SCIP
1074  * 4) copy all original variables
1075  * a) fix all variable copies specified by \p fixedvars, \p fixedvals, and \p nfixedvars
1076  * b) enable constraint compression
1077  * 5) copy all constraints
1078  *
1079  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
1080  *
1081  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1082  * Also, 'passmessagehdlr' should be set to FALSE.
1083  * @note Do not change the source SCIP environment during the copying process
1084  *
1085  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1086  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1087  *
1088  * @pre This method can be called if sourcescip is in one of the following stages:
1089  * - \ref SCIP_STAGE_PROBLEM
1090  * - \ref SCIP_STAGE_TRANSFORMED
1091  * - \ref SCIP_STAGE_INITPRESOLVE
1092  * - \ref SCIP_STAGE_PRESOLVING
1093  * - \ref SCIP_STAGE_EXITPRESOLVE
1094  * - \ref SCIP_STAGE_PRESOLVED
1095  * - \ref SCIP_STAGE_INITSOLVE
1096  * - \ref SCIP_STAGE_SOLVING
1097  * - \ref SCIP_STAGE_SOLVED
1098  *
1099  * @pre This method can be called if targetscip is in one of the following stages:
1100  * - \ref SCIP_STAGE_INIT
1101  * - \ref SCIP_STAGE_FREE
1102  *
1103  * @note sourcescip stage does not get changed
1104  *
1105  * @note targetscip stage does not get changed
1106  *
1107  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1108  */
1111  SCIP* sourcescip, /**< source SCIP data structure */
1112  SCIP* targetscip, /**< target SCIP data structure */
1113  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1114  * target variables, or NULL */
1115  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1116  * target constraints, or NULL */
1117  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
1118  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
1119  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, 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
1122  * plugins will be copied and activated, and the modifiable flag of
1123  * constraints will be respected. If FALSE, valid will be set to FALSE, when
1124  * there are pricers present */
1125  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
1126  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
1127  );
1128 
1129 /** checks if there is enough time and memory left for copying the sourcescip into a sub-SCIP and solve the sub-SCIP
1130  *
1131  * This is the case if the time and memory limit that would be passed to the sub-SCIP are larger than 0.0
1132  *
1133  * @pre This method can be called if sourcescip is in one of the following stages:
1134  * - \ref SCIP_STAGE_PROBLEM
1135  * - \ref SCIP_STAGE_TRANSFORMED
1136  * - \ref SCIP_STAGE_INITPRESOLVE
1137  * - \ref SCIP_STAGE_PRESOLVING
1138  * - \ref SCIP_STAGE_EXITPRESOLVE
1139  * - \ref SCIP_STAGE_PRESOLVED
1140  * - \ref SCIP_STAGE_INITSOLVE
1141  * - \ref SCIP_STAGE_SOLVING
1142  * - \ref SCIP_STAGE_SOLVED
1143  *
1144  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1145  */
1148  SCIP* sourcescip, /**< source SCIP data structure */
1149  SCIP_Bool* success /**< pointer to store whether there is time and memory left to copy the
1150  * problem and run the sub-SCIP */
1151  );
1152 
1153 /** copies limits from source SCIP to target SCIP
1154  *
1155  * @note time and memory limit are reduced by the amount already spent in the source SCIP before installing the limit
1156  * in the target SCIP
1157  * @note all other limits are disabled and need to be enabled afterwards, if needed
1158  *
1159  * @pre This method can be called if sourcescip is in one of the following stages:
1160  * - \ref SCIP_STAGE_PROBLEM
1161  * - \ref SCIP_STAGE_TRANSFORMED
1162  * - \ref SCIP_STAGE_INITPRESOLVE
1163  * - \ref SCIP_STAGE_PRESOLVING
1164  * - \ref SCIP_STAGE_EXITPRESOLVE
1165  * - \ref SCIP_STAGE_PRESOLVED
1166  * - \ref SCIP_STAGE_INITSOLVE
1167  * - \ref SCIP_STAGE_SOLVING
1168  * - \ref SCIP_STAGE_SOLVED
1169  *
1170  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1171  */
1174  SCIP* sourcescip, /**< source SCIP data structure */
1175  SCIP* targetscip /**< target SCIP data structure */
1176  );
1177 
1178 
1179 /**@} */
1180 
1181 #ifdef __cplusplus
1182 }
1183 #endif
1184 
1185 #endif
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
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
#define SCIP_EXPORT
Definition: def.h:98
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
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
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
SCIP_EXPORT SCIP_RETCODE SCIPcopyParamSettings(SCIP *sourcescip, SCIP *targetscip)
Definition: scip_copy.c:2248
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
type definitions for SCIP&#39;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
#define SCIP_Bool
Definition: def.h:70
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
#define SCIP_Real
Definition: def.h:164
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
SCIP_EXPORT int SCIPgetSubscipDepth(SCIP *scip)
Definition: scip_copy.c:2289
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