Scippy

SCIP

Solving Constraint Integer Programs

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 compr.h
26  * @ingroup INTERNALAPI
27  * @brief internal methods for tree compressions
28  * @author Jakob Witzig
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #ifndef __SCIP_COMPR_H__
34 #define __SCIP_COMPR_H__
35 
36 
37 #include "scip/def.h"
38 #include "blockmemshell/memory.h"
39 #include "scip/type_reopt.h"
40 #include "scip/type_retcode.h"
41 #include "scip/type_result.h"
42 #include "scip/type_set.h"
43 #include "scip/type_compr.h"
44 #include "scip/pub_compr.h"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 /** copies the given tree compression to a new scip */
52  SCIP_COMPR* compr, /**< tree compression */
53  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
54  );
55 
56 /** creates a tree compression */
58  SCIP_COMPR** compr, /**< pointer to tree compression data structure */
59  SCIP_SET* set, /**< global SCIP settings */
60  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
61  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
62  const char* name, /**< name of tree compression */
63  const char* desc, /**< description of tree compression */
64  int priority, /**< priority of the tree compression */
65  int minnnodes, /**< minimal number of nodes for calling compression */
66  SCIP_DECL_COMPRCOPY ((*comprcopy)), /**< copy method of tree compression or NULL if you don't want to copy
67  * your plugin into sub-SCIPs */
68  SCIP_DECL_COMPRFREE ((*comprfree)), /**< destructor of tree compression */
69  SCIP_DECL_COMPRINIT ((*comprinit)), /**< initialize tree compression */
70  SCIP_DECL_COMPREXIT ((*comprexit)), /**< deinitialize tree compression */
71  SCIP_DECL_COMPRINITSOL ((*comprinitsol)), /**< solving process initialization method of tree compression */
72  SCIP_DECL_COMPREXITSOL ((*comprexitsol)), /**< solving process deinitialization method of tree compression */
73  SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
74  SCIP_COMPRDATA* comprdata /**< tree compression data */
75  );
76 
77 /** calls destructor and frees memory of tree compression */
79  SCIP_COMPR** compr, /**< pointer to tree compression data structure */
80  SCIP_SET* set /**< global SCIP settings */
81  );
82 
83 /** initializes tree compression */
85  SCIP_COMPR* compr, /**< tree compression */
86  SCIP_SET* set /**< global SCIP settings */
87  );
88 
89 /** calls exit method of tree compression */
91  SCIP_COMPR* compr, /**< tree compression */
92  SCIP_SET* set /**< global SCIP settings */
93  );
94 
95 /** informs tree compression that the branch and bound process is being started */
97  SCIP_COMPR* compr, /**< tree compression */
98  SCIP_SET* set /**< global SCIP settings */
99  );
100 
101 /** informs tree compression that the branch and bound process data is being freed */
103  SCIP_COMPR* compr, /**< tree compression */
104  SCIP_SET* set /**< global SCIP settings */
105  );
106 
107 /** calls execution method of tree compression */
109  SCIP_COMPR* compr, /**< tree compression */
110  SCIP_SET* set, /**< global SCIP settings */
111  SCIP_REOPT* reopt, /**< reoptimization data structure */
112  SCIP_RESULT* result /**< pointer to store the result of the callback method */
113  );
114 
115 /** sets priority of tree compression */
117  SCIP_COMPR* compr, /**< tree compression */
118  SCIP_SET* set, /**< global SCIP settings */
119  int priority /**< new priority of the tree compression */
120  );
121 
122 /** sets copy callback of tree compression */
123 void SCIPcomprSetCopy(
124  SCIP_COMPR* compr, /**< tree compression */
125  SCIP_DECL_COMPRCOPY ((*comprcopy)) /**< copy callback of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
126  );
127 
128 /** sets destructor callback of tree compression */
129 void SCIPcomprSetFree(
130  SCIP_COMPR* compr, /**< tree compression */
131  SCIP_DECL_COMPRFREE ((*comprfree)) /**< destructor of tree compression */
132  );
133 
134 /** sets initialization callback of tree compression */
135 void SCIPcomprSetInit(
136  SCIP_COMPR* compr, /**< tree compression */
137  SCIP_DECL_COMPRINIT ((*comprinit)) /**< initialize tree compression */
138  );
139 
140 /** sets deinitialization callback of tree compression */
141 void SCIPcomprSetExit(
142  SCIP_COMPR* compr, /**< tree compression */
143  SCIP_DECL_COMPREXIT ((*comprexit)) /**< deinitialize tree compression */
144  );
145 
146 /** sets solving process initialization callback of tree compression */
148  SCIP_COMPR* compr, /**< tree compression */
149  SCIP_DECL_COMPRINITSOL ((*comprinitsol)) /**< solving process initialization callback of tree compression */
150  );
151 
152 /** sets solving process deinitialization callback of tree compression */
154  SCIP_COMPR* compr, /**< tree compression */
155  SCIP_DECL_COMPREXITSOL ((*comprexitsol)) /**< solving process deinitialization callback of tree compression */
156  );
157 
158 /** should the compression be executed at the given depth, frequency, timing, ... */
159 SCIP_EXPORT
161  SCIP_COMPR* compr, /**< tree compression */
162  int depth, /**< depth of current node */
163  int nnodes /**< number of open nodes */
164  );
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:61
void SCIPcomprSetCopy(SCIP_COMPR *compr, SCIP_DECL_COMPRCOPY((*comprcopy)))
Definition: compr.c:376
SCIP_RETCODE SCIPcomprCreate(SCIP_COMPR **compr, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, 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: compr.c:170
#define SCIP_DECL_COMPREXEC(x)
Definition: type_compr.h:120
SCIP_RETCODE SCIPcomprExitsol(SCIP_COMPR *compr, SCIP_SET *set)
#define SCIP_DECL_COMPREXITSOL(x)
Definition: type_compr.h:104
SCIP_RETCODE SCIPcomprInit(SCIP_COMPR *compr, SCIP_SET *set)
Definition: compr.c:230
void SCIPcomprSetPriority(SCIP_COMPR *compr, SCIP_SET *set, int priority)
Definition: compr.c:486
SCIP_RETCODE SCIPcomprExec(SCIP_COMPR *compr, SCIP_SET *set, SCIP_REOPT *reopt, SCIP_RESULT *result)
Definition: compr.c:299
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for global SCIP settings
void SCIPcomprSetExitsol(SCIP_COMPR *compr, SCIP_DECL_COMPREXITSOL((*comprexitsol)))
Definition: compr.c:431
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPcomprFree(SCIP_COMPR **compr, SCIP_SET *set)
Definition: compr.c:203
type definitions for collecting reoptimization information
void SCIPcomprSetInit(SCIP_COMPR *compr, SCIP_DECL_COMPRINIT((*comprinit)))
Definition: compr.c:398
#define SCIP_DECL_COMPRINIT(x)
Definition: type_compr.h:74
#define SCIP_DECL_COMPRFREE(x)
Definition: type_compr.h:66
#define SCIP_DECL_COMPRCOPY(x)
Definition: type_compr.h:58
SCIP_Bool SCIPcomprShouldBeExecuted(SCIP_COMPR *compr, int depth, int nnodes)
Definition: compr.c:442
SCIP_RETCODE SCIPcomprExit(SCIP_COMPR *compr, SCIP_SET *set)
Definition: compr.c:269
struct SCIP_ComprData SCIP_COMPRDATA
Definition: type_compr.h:49
#define SCIP_DECL_COMPRINITSOL(x)
Definition: type_compr.h:93
SCIP_RETCODE SCIPcomprCopyInclude(SCIP_COMPR *compr, SCIP_SET *set)
Definition: compr.c:84
#define SCIP_Bool
Definition: def.h:93
#define SCIP_DECL_COMPREXIT(x)
Definition: type_compr.h:82
type definitions for tree compression
public methods for tree compressions
void SCIPcomprSetFree(SCIP_COMPR *compr, SCIP_DECL_COMPRFREE((*comprfree)))
Definition: compr.c:387
result codes for SCIP callback methods
SCIP_RETCODE SCIPcomprInitsol(SCIP_COMPR *compr, SCIP_SET *set)
#define nnodes
Definition: gastrans.c:74
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:439
void SCIPcomprSetInitsol(SCIP_COMPR *compr, SCIP_DECL_COMPRINITSOL((*comprinitsol)))
Definition: compr.c:420
void SCIPcomprSetExit(SCIP_COMPR *compr, SCIP_DECL_COMPREXIT((*comprexit)))
Definition: compr.c:409
memory allocation routines