Scippy

SCIP

Solving Constraint Integer Programs

scip_compr.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-2018 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_compr.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for compression 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_COMPR_H__
32 #define __SCIP_SCIP_COMPR_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_compr.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 PublicCompressionMethods
65  *
66  * @{
67  */
68 /** creates a tree compression and includes it in SCIP.
69  *
70  * @note method has all compression callbacks as arguments and is thus changed every time a new
71  * callback is added in future releases; consider using SCIPincludeComprBasic() and setter functions
72  * if you seek for a method which is less likely to change in future releases
73  */
74 extern
76  SCIP* scip, /**< SCIP data structure */
77  const char* name, /**< name of tree compression */
78  const char* desc, /**< description of tree compression */
79  int priority, /**< priority of the tree compression */
80  int minnnodes, /**< minimal number of nodes to call compression */
81  SCIP_DECL_COMPRCOPY ((*comprcopy)), /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
82  SCIP_DECL_COMPRFREE ((*comprfree)), /**< destructor of tree compression */
83  SCIP_DECL_COMPRINIT ((*comprinit)), /**< initialize tree compression */
84  SCIP_DECL_COMPREXIT ((*comprexit)), /**< deinitialize tree compression */
85  SCIP_DECL_COMPRINITSOL ((*comprinitsol)), /**< solving process initialization method of tree compression */
86  SCIP_DECL_COMPREXITSOL ((*comprexitsol)), /**< solving process deinitialization method of tree compression */
87  SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
88  SCIP_COMPRDATA* comprdata /**< tree compression data */
89  );
90 
91 /** creates a tree compression and includes it in SCIP with its most fundamental callbacks.
92  * All non-fundamental (or optional) callbacks
93  * as, e. g., init and exit callbacks, will be set to NULL.
94  * Optional callbacks can be set via specific setter functions, see SCIPsetComprCopy(), SCIPsetComprFree(),
95  * SCIPsetComprInit(), SCIPsetComprExit(), SCIPsetComprInitsol(), and SCIPsetComprExitsol()
96  *
97  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeCompr() instead
98  */
99 extern
101  SCIP* scip, /**< SCIP data structure */
102  SCIP_COMPR** compr, /**< pointer to tree compression */
103  const char* name, /**< name of tree compression */
104  const char* desc, /**< description of tree compression */
105  int priority, /**< priority of the tree compression */
106  int minnnodes, /**< minimal number of nodes to call the compression */
107  SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
108  SCIP_COMPRDATA* comprdata /**< tree compression data */
109  );
110 
111 /** sets copy method of tree compression */
112 extern
114  SCIP* scip, /**< SCIP data structure */
115  SCIP_COMPR* compr, /**< tree compression */
116  SCIP_DECL_COMPRCOPY ((*comprcopy)) /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
117  );
118 
119 /** sets destructor method of tree compression */
120 extern
122  SCIP* scip, /**< SCIP data structure */
123  SCIP_COMPR* compr, /**< tree compression */
124  SCIP_DECL_COMPRFREE ((*comprfree)) /**< destructor of tree compression */
125  );
126 
127 /** sets initialization method of tree compression */
128 extern
130  SCIP* scip, /**< SCIP data structure */
131  SCIP_COMPR* compr, /**< tree compression */
132  SCIP_DECL_COMPRINIT ((*comprinit)) /**< initialize tree compression */
133  );
134 
135 /** sets deinitialization method of tree compression */
136 extern
138  SCIP* scip, /**< SCIP data structure */
139  SCIP_COMPR* compr, /**< tree compression */
140  SCIP_DECL_COMPREXIT ((*comprexit)) /**< deinitialize tree compression */
141  );
142 
143 /** sets solving process initialization method of tree compression */
144 extern
146  SCIP* scip, /**< SCIP data structure */
147  SCIP_COMPR* compr, /**< tree compression */
148  SCIP_DECL_COMPRINITSOL ((*comprinitsol)) /**< solving process initialization method of tree compression */
149  );
150 
151 /** sets solving process deinitialization method of tree compression */
152 extern
154  SCIP* scip, /**< SCIP data structure */
155  SCIP_COMPR* compr, /**< tree compression */
156  SCIP_DECL_COMPREXITSOL ((*comprexitsol)) /**< solving process deinitialization method of tree compression */
157  );
158 
159 /** returns the tree compression of the given name, or NULL if not existing */
160 extern
162  SCIP* scip, /**< SCIP data structure */
163  const char* name /**< name of tree compression */
164  );
165 
166 /** returns the array of currently available tree compression */
167 extern
169  SCIP* scip /**< SCIP data structure */
170  );
171 
172 /** returns the number of currently available tree compression */
173 extern
174 int SCIPgetNCompr(
175  SCIP* scip /**< SCIP data structure */
176  );
177 
178 /** set the priority of a tree compression method */
180  SCIP* scip, /**< SCIP data structure */
181  SCIP_COMPR* compr, /**< compression */
182  int priority /**< new priority of the tree compression */
183  );
184 
185 /* @} */
186 
187 #ifdef __cplusplus
188 }
189 #endif
190 
191 #endif
SCIP_RETCODE SCIPsetComprFree(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRFREE((*comprfree)))
Definition: scip_compr.c:227
internal methods for branch and bound tree
#define SCIP_DECL_COMPREXEC(x)
Definition: type_compr.h:111
SCIP_RETCODE SCIPsetComprInit(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRINIT((*comprinit)))
Definition: scip_compr.c:243
#define SCIP_DECL_COMPREXITSOL(x)
Definition: type_compr.h:95
SCIP_RETCODE SCIPincludeCompr(SCIP *scip, const char *name, const char *desc, int priority, int minnnodes, SCIP_DECL_COMPRCOPY((*comprcopy)), SCIP_DECL_COMPRFREE((*comprfree)), SCIP_DECL_COMPRINIT((*comprinit)), SCIP_DECL_COMPREXIT((*comprexit)), SCIP_DECL_COMPRINITSOL((*comprinitsol)), SCIP_DECL_COMPREXITSOL((*comprexitsol)), SCIP_DECL_COMPREXEC((*comprexec)), SCIP_COMPRDATA *comprdata)
Definition: scip_compr.c:130
SCIP_COMPR * SCIPfindCompr(SCIP *scip, const char *name)
Definition: scip_compr.c:307
SCIP_RETCODE SCIPincludeComprBasic(SCIP *scip, SCIP_COMPR **compr, const char *name, const char *desc, int priority, int minnnodes, SCIP_DECL_COMPREXEC((*comprexec)), SCIP_COMPRDATA *comprdata)
Definition: scip_compr.c:173
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPsetComprInitsol(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRINITSOL((*comprinitsol)))
Definition: scip_compr.c:275
type definitions for return codes for SCIP methods
#define SCIP_DECL_COMPRINIT(x)
Definition: type_compr.h:65
#define SCIP_DECL_COMPRFREE(x)
Definition: type_compr.h:57
SCIP_RETCODE SCIPsetComprCopy(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRCOPY((*comprcopy)))
Definition: scip_compr.c:211
#define SCIP_DECL_COMPRCOPY(x)
Definition: type_compr.h:49
type definitions for SCIP&#39;s main datastructure
internal miscellaneous methods
internal methods for global SCIP settings
SCIP main data structure.
struct SCIP_ComprData SCIP_COMPRDATA
Definition: type_compr.h:40
#define SCIP_DECL_COMPRINITSOL(x)
Definition: type_compr.h:84
internal methods for problem variables
SCIP_COMPR ** SCIPgetComprs(SCIP *scip)
Definition: scip_compr.c:320
SCIP_RETCODE SCIPsetComprExitsol(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPREXITSOL((*comprexitsol)))
Definition: scip_compr.c:291
methods for debugging
#define SCIP_DECL_COMPREXIT(x)
Definition: type_compr.h:73
datastructures for problem statistics
SCIP_RETCODE SCIPsetComprPriority(SCIP *scip, SCIP_COMPR *compr, int priority)
Definition: scip_compr.c:344
internal methods for main solving loop and node processing
type definitions for tree compression
SCIP_RETCODE SCIPsetComprExit(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPREXIT((*comprexit)))
Definition: scip_compr.c:259
result codes for SCIP callback methods
internal methods for constraints and constraint handlers
int SCIPgetNCompr(SCIP *scip)
Definition: scip_compr.c:333
common defines and data types used in all packages of SCIP