Scippy

SCIP

Solving Constraint Integer Programs

pub_dcmp.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-2022 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file pub_dcmp.h
17  * @ingroup DecompMethods
18  * @brief public methods for decompositions
19  * @author Gregor Hendel
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef SCIP_PUB_DECOMP_H_
25 #define SCIP_PUB_DECOMP_H_
26 
27 
28 #include "blockmemshell/memory.h"
29 #include "scip/type_cons.h"
30 #include "scip/type_dcmp.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /**@addtogroup DecompMethods
37  *
38  * @{
39  */
40 
41 /** creates a decomposition */
42 SCIP_EXPORT
44  SCIP_DECOMP** decomp, /**< pointer to store the decomposition data structure */
45  BMS_BLKMEM* blkmem, /**< block memory */
46  int nblocks, /**< the number of blocks (without the linking block) */
47  SCIP_Bool original, /**< is this a decomposition in the original (TRUE) or transformed space? */
48  SCIP_Bool benderslabels /**< should the variables be labeled for the application of Benders' decomposition */
49  );
50 
51 /** frees a decomposition */
52 SCIP_EXPORT
53 void SCIPdecompFree(
54  SCIP_DECOMP** decomp, /**< pointer to store the decomposition data structure */
55  BMS_BLKMEM* blkmem /**< block memory */
56  );
57 
58 /** returns TRUE if decomposition is in the original space */
59 SCIP_EXPORT
61  SCIP_DECOMP* decomp /**< decomposition data structure */
62  );
63 
64 /** sets the parameter that indicates whether the variables must be labeled for the application of Benders'
65  * decomposition
66  */
67 SCIP_EXPORT
69  SCIP_DECOMP* decomp, /**< decomposition data structure */
70  SCIP_Bool benderslabels /**< whether Benders' variable labels should be used */
71  );
72 
73 /** returns TRUE if the variables must be labeled for the application of Benders' decomposition */
74 SCIP_EXPORT
76  SCIP_DECOMP* decomp /**< decomposition data structure */
77  );
78 
79 /** gets number of blocks of this decomposition */
80 SCIP_EXPORT
82  SCIP_DECOMP* decomp /**< decomposition data structure */
83  );
84 
85 /** gets area score of this decomposition */
86 SCIP_EXPORT
88  SCIP_DECOMP* decomp /**< decomposition data structure */
89  );
90 
91 /** gets modularity of this decomposition */
92 SCIP_EXPORT
94  SCIP_DECOMP* decomp /**< decomposition data structure */
95  );
96 
97 /** gets variable size for each block, sorted by increasing block label
98  *
99  * To get all variable sizes, set nlabels to SCIPdecompGetNBlocks() + 1.
100  * The first entry corresponds to the number of border variables.
101  *
102  * @note Ensure that SCIPcomputeDecompStats() has been called before.
103  * If the decomposition was read from a file, this was done automatically.
104  */
105 SCIP_EXPORT
107  SCIP_DECOMP* decomp, /**< decomposition data structure */
108  int* varssize, /**< array to store variable sizes of blocks*/
109  int nblocks /**< length of variable sizes array */
110  );
111 
112 /** gets constraint size for each block, sorted by increasing block label
113  *
114  * To get all constraint sizes, set nlabels to SCIPdecompGetNBlocks() + 1.
115  * The first entry corresponds to the number of border constraints.
116  *
117  * @note Ensure that SCIPcomputeDecompStats() has been called before.
118  * If the decomposition was read from a file, this was done automatically.
119  */
120 SCIP_EXPORT
122  SCIP_DECOMP* decomp, /**< decomposition data structure */
123  int* consssize, /**< array to store constraint sizes of blocks*/
124  int nblocks /**< length of constraint sizes array */
125  );
126 
127 /** gets number of border variables of this decomposition
128  *
129  * @note Ensure that SCIPcomputeDecompStats() has been called before.
130  * If the decomposition was read from a file, this was done automatically.
131  */
132 SCIP_EXPORT
134  SCIP_DECOMP* decomp /**< decomposition data structure */
135  );
136 
137 /** gets number of border constraints of this decomposition
138  *
139  * @note Ensure that SCIPcomputeDecompStats() has been called before.
140  * If the decomposition was read from a file, this was done automatically.
141  */
142 SCIP_EXPORT
144  SCIP_DECOMP* decomp /**< decomposition data structure */
145  );
146 
147 /** gets number of edges in the block-decomposition graph of this decomposition */
148 SCIP_EXPORT
150  SCIP_DECOMP* decomp /**< decomposition data structure */
151  );
152 
153 /** gets number of connected components in the block-decomposition graph of this decomposition */
154 SCIP_EXPORT
156  SCIP_DECOMP* decomp /**< decomposition data structure */
157  );
158 
159 /** gets number of articulation points in the block-decomposition graph of this decomposition */
160 SCIP_EXPORT
162  SCIP_DECOMP* decomp /**< decomposition data structure */
163  );
164 
165 /** gets the maximum degree of the block-decomposition graph of this decomposition */
166 SCIP_EXPORT
168  SCIP_DECOMP* decomp /**< decomposition data structure */
169  );
170 
171 /** gets the minimum degree of the block-decomposition graph of this decomposition */
172 SCIP_EXPORT
174  SCIP_DECOMP* decomp /**< decomposition data structure */
175  );
176 
177 /** sets labels for an array of variables */
178 SCIP_EXPORT
180  SCIP_DECOMP* decomp, /**< decomposition data structure */
181  SCIP_VAR** vars, /**< array of variables */
182  int* labels, /**< array of labels, one per variable */
183  int nvars /**< length of variables array */
184  );
185 
186 /** queries labels for an array of variables */
187 SCIP_EXPORT
189  SCIP_DECOMP* decomp, /**< decomposition data structure */
190  SCIP_VAR** vars, /**< array of variables */
191  int* labels, /**< buffer to store labels, one per variable */
192  int nvars /**< length of variables array */
193  );
194 
195 /** sets labels for an array of constraints */
196 SCIP_EXPORT
198  SCIP_DECOMP* decomp, /**< decomposition data structure */
199  SCIP_CONS** conss, /**< array of constraints */
200  int* labels, /**< array of labels, one per constraint */
201  int nconss /**< length of constraints array */
202  );
203 
204 /** queries labels for an array of constraints */
205 SCIP_EXPORT
207  SCIP_DECOMP* decomp, /**< decomposition data structure */
208  SCIP_CONS** conss, /**< array of constraints */
209  int* labels, /**< array of labels, one per constraint */
210  int nconss /**< length of constraints array */
211  );
212 
213 /** clears the corresponding labeling (constraints, variables, or both) of this decomposition */
214 SCIP_EXPORT
216  SCIP_DECOMP* decomp, /**< decomposition data structure */
217  SCIP_Bool clearvarlabels, /**< should the variable labels be cleared? */
218  SCIP_Bool clearconslabels /**< should the constraint labels be cleared? */
219  );
220 
221 /** prints decomposition statistics into string buffer */
222 SCIP_EXPORT
224  SCIP_DECOMP* decomp, /**< decomposition data structure */
225  char* strbuf /**< string buffer storage */
226  );
227 
228 /** @} */
229 
230 #ifdef __cplusplus
231 }
232 #endif
233 
234 #endif
void SCIPdecompGetConsLabels(SCIP_DECOMP *decomp, SCIP_CONS **conss, int *labels, int nconss)
Definition: dcmp.c:188
int SCIPdecompGetNBorderVars(SCIP_DECOMP *decomp)
Definition: dcmp.c:369
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
int SCIPdecompGetBlockGraphMaxDegree(SCIP_DECOMP *decomp)
Definition: dcmp.c:425
void SCIPdecompGetVarsLabels(SCIP_DECOMP *decomp, SCIP_VAR **vars, int *labels, int nvars)
Definition: dcmp.c:139
SCIP_RETCODE SCIPdecompSetVarsLabels(SCIP_DECOMP *decomp, SCIP_VAR **vars, int *labels, int nvars)
Definition: dcmp.c:114
SCIP_Bool SCIPdecompIsOriginal(SCIP_DECOMP *decomp)
Definition: dcmp.c:236
SCIP_RETCODE SCIPdecompGetVarsSize(SCIP_DECOMP *decomp, int *varssize, int nblocks)
Definition: dcmp.c:306
int SCIPdecompGetNBlockGraphComponents(SCIP_DECOMP *decomp)
Definition: dcmp.c:405
int SCIPdecompGetNBlocks(SCIP_DECOMP *decomp)
Definition: dcmp.c:269
SCIP_RETCODE SCIPdecompSetConsLabels(SCIP_DECOMP *decomp, SCIP_CONS **conss, int *labels, int nconss)
Definition: dcmp.c:163
#define SCIP_Bool
Definition: def.h:84
SCIP_RETCODE SCIPdecompClear(SCIP_DECOMP *decomp, SCIP_Bool clearvarlabels, SCIP_Bool clearconslabels)
Definition: dcmp.c:214
SCIP_Real SCIPdecompGetAreaScore(SCIP_DECOMP *decomp)
Definition: dcmp.c:279
int SCIPdecompGetNBlockGraphEdges(SCIP_DECOMP *decomp)
Definition: dcmp.c:395
SCIP_RETCODE SCIPdecompCreate(SCIP_DECOMP **decomp, BMS_BLKMEM *blkmem, int nblocks, SCIP_Bool original, SCIP_Bool benderslabels)
Definition: dcmp.c:47
int SCIPdecompGetBlockGraphMinDegree(SCIP_DECOMP *decomp)
Definition: dcmp.c:435
char * SCIPdecompPrintStats(SCIP_DECOMP *decomp, char *strbuf)
Definition: dcmp.c:445
SCIP_Real SCIPdecompGetModularity(SCIP_DECOMP *decomp)
Definition: dcmp.c:289
#define SCIP_Real
Definition: def.h:177
type definitions for decompositions and the decomposition store
void SCIPdecompSetUseBendersLabels(SCIP_DECOMP *decomp, SCIP_Bool benderslabels)
Definition: dcmp.c:248
void SCIPdecompFree(SCIP_DECOMP **decomp, BMS_BLKMEM *blkmem)
Definition: dcmp.c:89
SCIP_Bool SCIPdecompUseBendersLabels(SCIP_DECOMP *decomp)
Definition: dcmp.c:259
SCIP_RETCODE SCIPdecompGetConssSize(SCIP_DECOMP *decomp, int *consssize, int nblocks)
Definition: dcmp.c:339
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:430
int SCIPdecompGetNBorderConss(SCIP_DECOMP *decomp)
Definition: dcmp.c:384
int SCIPdecompGetNBlockGraphArticulations(SCIP_DECOMP *decomp)
Definition: dcmp.c:415
type definitions for constraints and constraint handlers
memory allocation routines