Scippy

SCIP

Solving Constraint Integer Programs

scip_relax.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_relax.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for relaxator plugins
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_RELAX_H__
32 #define __SCIP_SCIP_RELAX_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_relax.h"
37 #include "scip/type_result.h"
38 #include "scip/type_retcode.h"
39 #include "scip/type_scip.h"
40 
41 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
42  * this structure except the interface methods in scip.c.
43  * In optimized mode, the structure is included in scip.h, because some of the methods
44  * are implemented as defines for performance reasons (e.g. the numerical comparisons).
45  * Additionally, the internal "set.h" is included, such that the defines in set.h are
46  * available in optimized mode.
47  */
48 #ifdef NDEBUG
49 #include "scip/struct_scip.h"
50 #include "scip/struct_stat.h"
51 #include "scip/set.h"
52 #include "scip/tree.h"
53 #include "scip/misc.h"
54 #include "scip/var.h"
55 #include "scip/cons.h"
56 #include "scip/solve.h"
57 #include "scip/debug.h"
58 #endif
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 /**@addtogroup PublicRelaxatorMethods
65  *
66  * @{
67  */
68 
69 /** creates a relaxation handler and includes it in SCIP
70  *
71  * @note method has all relaxation handler callbacks as arguments and is thus changed every time a new
72  * callback is added
73  * in future releases; consider using SCIPincludeRelaxBasic() and setter functions
74  * if you seek for a method which is less likely to change in future releases
75  */
76 extern
78  SCIP* scip, /**< SCIP data structure */
79  const char* name, /**< name of relaxation handler */
80  const char* desc, /**< description of relaxation handler */
81  int priority, /**< priority of the relaxation handler (negative: after LP, non-negative: before LP) */
82  int freq, /**< frequency for calling relaxation handler */
83  SCIP_DECL_RELAXCOPY ((*relaxcopy)), /**< copy method of relaxation handler or NULL if you don't want to copy your plugin into sub-SCIPs */
84  SCIP_DECL_RELAXFREE ((*relaxfree)), /**< destructor of relaxation handler */
85  SCIP_DECL_RELAXINIT ((*relaxinit)), /**< initialize relaxation handler */
86  SCIP_DECL_RELAXEXIT ((*relaxexit)), /**< deinitialize relaxation handler */
87  SCIP_DECL_RELAXINITSOL((*relaxinitsol)), /**< solving process initialization method of relaxation handler */
88  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), /**< solving process deinitialization method of relaxation handler */
89  SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxation handler */
90  SCIP_RELAXDATA* relaxdata /**< relaxation handler data */
91  );
92 
93 /** creates a relaxation handler and includes it in SCIP. All non fundamental
94  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
95  * Optional callbacks can be set via specific setter functions, see SCIPsetRelaxInit(), SCIPsetRelaxExit(),
96  * SCIPsetRelaxCopy(), SCIPsetRelaxFree(), SCIPsetRelaxInitsol(), and SCIPsetRelaxExitsol()
97  *
98  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeRelax() instead
99  */
100 extern
102  SCIP* scip, /**< SCIP data structure */
103  SCIP_RELAX** relaxptr, /**< reference to relaxation pointer, or NULL */
104  const char* name, /**< name of relaxation handler */
105  const char* desc, /**< description of relaxation handler */
106  int priority, /**< priority of the relaxation handler (negative: after LP, non-negative: before LP) */
107  int freq, /**< frequency for calling relaxation handler */
108  SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxation handler */
109  SCIP_RELAXDATA* relaxdata /**< relaxation handler data */
110  );
111 
112 /** sets copy method of relaxation handler */
113 extern
115  SCIP* scip, /**< SCIP data structure */
116  SCIP_RELAX* relax, /**< relaxation handler */
117  SCIP_DECL_RELAXCOPY ((*relaxcopy)) /**< copy method of relaxation handler or NULL if you don't want to copy your plugin into sub-SCIPs */
118  );
119 
120 /** sets destructor method of relaxation handler */
121 extern
123  SCIP* scip, /**< SCIP data structure */
124  SCIP_RELAX* relax, /**< relaxation handler */
125  SCIP_DECL_RELAXFREE ((*relaxfree)) /**< destructor of relaxation handler */
126  );
127 
128 /** sets initialization method of relaxation handler */
129 extern
131  SCIP* scip, /**< SCIP data structure */
132  SCIP_RELAX* relax, /**< relaxation handler */
133  SCIP_DECL_RELAXINIT ((*relaxinit)) /**< initialize relaxation handler */
134  );
135 
136 /** sets deinitialization method of relaxation handler */
137 extern
139  SCIP* scip, /**< SCIP data structure */
140  SCIP_RELAX* relax, /**< relaxation handler */
141  SCIP_DECL_RELAXEXIT ((*relaxexit)) /**< deinitialize relaxation handler */
142  );
143 
144 /** sets solving process initialization method of relaxation handler */
145 extern
147  SCIP* scip, /**< SCIP data structure */
148  SCIP_RELAX* relax, /**< relaxation handler */
149  SCIP_DECL_RELAXINITSOL((*relaxinitsol)) /**< solving process initialization method of relaxation handler */
150  );
151 
152 /** sets solving process deinitialization method of relaxation handler */
153 extern
155  SCIP* scip, /**< SCIP data structure */
156  SCIP_RELAX* relax, /**< relaxation handler */
157  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)) /**< solving process deinitialization method of relaxation handler */
158  );
159 
160 /** returns the relaxation handler of the given name, or NULL if not existing */
161 extern
163  SCIP* scip, /**< SCIP data structure */
164  const char* name /**< name of relaxation handler */
165  );
166 
167 /** returns the array of currently available relaxation handlers */
168 extern
170  SCIP* scip /**< SCIP data structure */
171  );
172 
173 /** returns the number of currently available relaxation handlers */
174 extern
175 int SCIPgetNRelaxs(
176  SCIP* scip /**< SCIP data structure */
177  );
178 
179 /** sets the priority of a relaxation handler*/
180 extern
182  SCIP* scip, /**< SCIP data structure */
183  SCIP_RELAX* relax, /**< relaxation handler */
184  int priority /**< new priority of the relaxation handler */
185  );
186 
187 /* @} */
188 
189 #ifdef __cplusplus
190 }
191 #endif
192 
193 #endif
#define SCIP_DECL_RELAXFREE(x)
Definition: type_relax.h:55
SCIP_RETCODE SCIPsetRelaxCopy(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXCOPY((*relaxcopy)))
Definition: scip_relax.c:207
internal methods for branch and bound tree
int SCIPgetNRelaxs(SCIP *scip)
Definition: scip_relax.c:330
SCIP_RETCODE SCIPsetRelaxInit(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXINIT((*relaxinit)))
Definition: scip_relax.c:239
SCIP_RELAX ** SCIPgetRelaxs(SCIP *scip)
Definition: scip_relax.c:317
SCIP_RETCODE SCIPsetRelaxExitsol(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXEXITSOL((*relaxexitsol)))
Definition: scip_relax.c:287
SCIP_RETCODE SCIPincludeRelaxBasic(SCIP *scip, SCIP_RELAX **relaxptr, const char *name, const char *desc, int priority, int freq, SCIP_DECL_RELAXEXEC((*relaxexec)), SCIP_RELAXDATA *relaxdata)
Definition: scip_relax.c:173
#define SCIP_DECL_RELAXINIT(x)
Definition: type_relax.h:63
#define SCIP_DECL_RELAXINITSOL(x)
Definition: type_relax.h:82
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPincludeRelax(SCIP *scip, const char *name, const char *desc, int priority, int freq, SCIP_DECL_RELAXCOPY((*relaxcopy)), SCIP_DECL_RELAXFREE((*relaxfree)), SCIP_DECL_RELAXINIT((*relaxinit)), SCIP_DECL_RELAXEXIT((*relaxexit)), SCIP_DECL_RELAXINITSOL((*relaxinitsol)), SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), SCIP_DECL_RELAXEXEC((*relaxexec)), SCIP_RELAXDATA *relaxdata)
Definition: scip_relax.c:131
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPsetRelaxFree(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXFREE((*relaxfree)))
Definition: scip_relax.c:223
#define SCIP_DECL_RELAXEXIT(x)
Definition: type_relax.h:71
type definitions for SCIP&#39;s main datastructure
internal miscellaneous methods
#define SCIP_DECL_RELAXCOPY(x)
Definition: type_relax.h:47
internal methods for global SCIP settings
SCIP main data structure.
type definitions for relaxators
SCIP_RETCODE SCIPsetRelaxPriority(SCIP *scip, SCIP_RELAX *relax, int priority)
Definition: scip_relax.c:341
SCIP_RETCODE SCIPsetRelaxExit(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXEXIT((*relaxexit)))
Definition: scip_relax.c:255
internal methods for problem variables
methods for debugging
datastructures for problem statistics
struct SCIP_RelaxData SCIP_RELAXDATA
Definition: type_relax.h:38
#define SCIP_DECL_RELAXEXEC(x)
Definition: type_relax.h:118
internal methods for main solving loop and node processing
result codes for SCIP callback methods
internal methods for constraints and constraint handlers
#define SCIP_DECL_RELAXEXITSOL(x)
Definition: type_relax.h:93
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPsetRelaxInitsol(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXINITSOL((*relaxinitsol)))
Definition: scip_relax.c:271
SCIP_RELAX * SCIPfindRelax(SCIP *scip, const char *name)
Definition: scip_relax.c:304