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 2002-2022 Zuse Institute Berlin */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file scip_compr.h
26  * @ingroup PUBLICCOREAPI
27  * @brief public methods for compression plugins
28  * @author Tobias Achterberg
29  * @author Timo Berthold
30  * @author Thorsten Koch
31  * @author Alexander Martin
32  * @author Marc Pfetsch
33  * @author Kati Wolter
34  * @author Gregor Hendel
35  * @author Leona Gottwald
36  */
37 
38 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39 
40 #ifndef __SCIP_SCIP_COMPR_H__
41 #define __SCIP_SCIP_COMPR_H__
42 
43 
44 #include "scip/def.h"
45 #include "scip/type_compr.h"
46 #include "scip/type_result.h"
47 #include "scip/type_retcode.h"
48 #include "scip/type_scip.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /**@addtogroup PublicCompressionMethods
55  *
56  * @{
57  */
58 /** creates a tree compression and includes it in SCIP.
59  *
60  * @note method has all compression callbacks as arguments and is thus changed every time a new
61  * callback is added in future releases; consider using SCIPincludeComprBasic() and setter functions
62  * if you seek for a method which is less likely to change in future releases
63  */
64 SCIP_EXPORT
66  SCIP* scip, /**< SCIP data structure */
67  const char* name, /**< name of tree compression */
68  const char* desc, /**< description of tree compression */
69  int priority, /**< priority of the tree compression */
70  int minnnodes, /**< minimal number of nodes to call compression */
71  SCIP_DECL_COMPRCOPY ((*comprcopy)), /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
72  SCIP_DECL_COMPRFREE ((*comprfree)), /**< destructor of tree compression */
73  SCIP_DECL_COMPRINIT ((*comprinit)), /**< initialize tree compression */
74  SCIP_DECL_COMPREXIT ((*comprexit)), /**< deinitialize tree compression */
75  SCIP_DECL_COMPRINITSOL ((*comprinitsol)), /**< solving process initialization method of tree compression */
76  SCIP_DECL_COMPREXITSOL ((*comprexitsol)), /**< solving process deinitialization method of tree compression */
77  SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
78  SCIP_COMPRDATA* comprdata /**< tree compression data */
79  );
80 
81 /** creates a tree compression and includes it in SCIP with its most fundamental callbacks.
82  * All non-fundamental (or optional) callbacks
83  * as, e. g., init and exit callbacks, will be set to NULL.
84  * Optional callbacks can be set via specific setter functions, see SCIPsetComprCopy(), SCIPsetComprFree(),
85  * SCIPsetComprInit(), SCIPsetComprExit(), SCIPsetComprInitsol(), and SCIPsetComprExitsol()
86  *
87  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeCompr() instead
88  */
89 SCIP_EXPORT
91  SCIP* scip, /**< SCIP data structure */
92  SCIP_COMPR** compr, /**< pointer to tree compression */
93  const char* name, /**< name of tree compression */
94  const char* desc, /**< description of tree compression */
95  int priority, /**< priority of the tree compression */
96  int minnnodes, /**< minimal number of nodes to call the compression */
97  SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
98  SCIP_COMPRDATA* comprdata /**< tree compression data */
99  );
100 
101 /** sets copy method of tree compression */
102 SCIP_EXPORT
104  SCIP* scip, /**< SCIP data structure */
105  SCIP_COMPR* compr, /**< tree compression */
106  SCIP_DECL_COMPRCOPY ((*comprcopy)) /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
107  );
108 
109 /** sets destructor method of tree compression */
110 SCIP_EXPORT
112  SCIP* scip, /**< SCIP data structure */
113  SCIP_COMPR* compr, /**< tree compression */
114  SCIP_DECL_COMPRFREE ((*comprfree)) /**< destructor of tree compression */
115  );
116 
117 /** sets initialization method of tree compression */
118 SCIP_EXPORT
120  SCIP* scip, /**< SCIP data structure */
121  SCIP_COMPR* compr, /**< tree compression */
122  SCIP_DECL_COMPRINIT ((*comprinit)) /**< initialize tree compression */
123  );
124 
125 /** sets deinitialization method of tree compression */
126 SCIP_EXPORT
128  SCIP* scip, /**< SCIP data structure */
129  SCIP_COMPR* compr, /**< tree compression */
130  SCIP_DECL_COMPREXIT ((*comprexit)) /**< deinitialize tree compression */
131  );
132 
133 /** sets solving process initialization method of tree compression */
134 SCIP_EXPORT
136  SCIP* scip, /**< SCIP data structure */
137  SCIP_COMPR* compr, /**< tree compression */
138  SCIP_DECL_COMPRINITSOL ((*comprinitsol)) /**< solving process initialization method of tree compression */
139  );
140 
141 /** sets solving process deinitialization method of tree compression */
142 SCIP_EXPORT
144  SCIP* scip, /**< SCIP data structure */
145  SCIP_COMPR* compr, /**< tree compression */
146  SCIP_DECL_COMPREXITSOL ((*comprexitsol)) /**< solving process deinitialization method of tree compression */
147  );
148 
149 /** returns the tree compression of the given name, or NULL if not existing */
150 SCIP_EXPORT
152  SCIP* scip, /**< SCIP data structure */
153  const char* name /**< name of tree compression */
154  );
155 
156 /** returns the array of currently available tree compression */
157 SCIP_EXPORT
159  SCIP* scip /**< SCIP data structure */
160  );
161 
162 /** returns the number of currently available tree compression */
163 SCIP_EXPORT
164 int SCIPgetNCompr(
165  SCIP* scip /**< SCIP data structure */
166  );
167 
168 /** set the priority of a tree compression method */
170  SCIP* scip, /**< SCIP data structure */
171  SCIP_COMPR* compr, /**< compression */
172  int priority /**< new priority of the tree compression */
173  );
174 
175 /** @} */
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
181 #endif
SCIP_RETCODE SCIPsetComprFree(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRFREE((*comprfree)))
Definition: scip_compr.c:157
#define SCIP_DECL_COMPREXEC(x)
Definition: type_compr.h:120
SCIP_RETCODE SCIPsetComprInit(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRINIT((*comprinit)))
Definition: scip_compr.c:173
#define SCIP_DECL_COMPREXITSOL(x)
Definition: type_compr.h:104
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:60
SCIP_COMPR * SCIPfindCompr(SCIP *scip, const char *name)
Definition: scip_compr.c:237
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:103
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_RETCODE SCIPsetComprInitsol(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRINITSOL((*comprinitsol)))
Definition: scip_compr.c:205
type definitions for return codes for SCIP methods
#define SCIP_DECL_COMPRINIT(x)
Definition: type_compr.h:74
#define SCIP_DECL_COMPRFREE(x)
Definition: type_compr.h:66
SCIP_RETCODE SCIPsetComprCopy(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRCOPY((*comprcopy)))
Definition: scip_compr.c:141
#define SCIP_DECL_COMPRCOPY(x)
Definition: type_compr.h:58
type definitions for SCIP&#39;s main datastructure
struct SCIP_ComprData SCIP_COMPRDATA
Definition: type_compr.h:49
#define SCIP_DECL_COMPRINITSOL(x)
Definition: type_compr.h:93
SCIP_COMPR ** SCIPgetComprs(SCIP *scip)
Definition: scip_compr.c:250
SCIP_RETCODE SCIPsetComprExitsol(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPREXITSOL((*comprexitsol)))
Definition: scip_compr.c:221
#define SCIP_DECL_COMPREXIT(x)
Definition: type_compr.h:82
SCIP_RETCODE SCIPsetComprPriority(SCIP *scip, SCIP_COMPR *compr, int priority)
Definition: scip_compr.c:274
type definitions for tree compression
SCIP_RETCODE SCIPsetComprExit(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPREXIT((*comprexit)))
Definition: scip_compr.c:189
result codes for SCIP callback methods
int SCIPgetNCompr(SCIP *scip)
Definition: scip_compr.c:263
common defines and data types used in all packages of SCIP