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-2020 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 */
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 */
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 */
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  */
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 */
76  SCIP_DECOMP* decomp /**< decomposition data structure */
77  );
78 
79 /** gets number of blocks of this decomposition */
82  SCIP_DECOMP* decomp /**< decomposition data structure */
83  );
84 
85 /** gets area score of this decomposition */
88  SCIP_DECOMP* decomp /**< decomposition data structure */
89  );
90 
91 /** gets modularity of this decomposition */
94  SCIP_DECOMP* decomp /**< decomposition data structure */
95  );
96 
97 /** gets number of edges in the block-decomposition graph of this decomposition */
100  SCIP_DECOMP* decomp /**< decomposition data structure */
101  );
102 
103 /** gets number of connected components in the block-decomposition graph of this decomposition */
106  SCIP_DECOMP* decomp /**< decomposition data structure */
107  );
108 
109 /** gets number of articulation points in the block-decomposition graph of this decomposition */
112  SCIP_DECOMP* decomp /**< decomposition data structure */
113  );
114 
115 /** gets the maximum degree of the block-decomposition graph of this decomposition */
118  SCIP_DECOMP* decomp /**< decomposition data structure */
119  );
120 
121 /** gets the minimum degree of the block-decomposition graph of this decomposition */
124  SCIP_DECOMP* decomp /**< decomposition data structure */
125  );
126 
127 /** sets labels for an array of variables */
130  SCIP_DECOMP* decomp, /**< decomposition data structure */
131  SCIP_VAR** vars, /**< array of variables */
132  int* labels, /**< array of labels, one per variable */
133  int nvars /**< length of variables array */
134  );
135 
136 /** queries labels for an array of variables */
139  SCIP_DECOMP* decomp, /**< decomposition data structure */
140  SCIP_VAR** vars, /**< array of variables */
141  int* labels, /**< buffer to store labels, one per variable */
142  int nvars /**< length of variables array */
143  );
144 
145 /** sets labels for an array of constraints */
148  SCIP_DECOMP* decomp, /**< decomposition data structure */
149  SCIP_CONS** conss, /**< array of constraints */
150  int* labels, /**< array of labels, one per constraint */
151  int nconss /**< length of constraints array */
152  );
153 
154 /** queries labels for an array of constraints */
157  SCIP_DECOMP* decomp, /**< decomposition data structure */
158  SCIP_CONS** conss, /**< array of constraints */
159  int* labels, /**< array of labels, one per constraint */
160  int nconss /**< length of constraints array */
161  );
162 
163 /** clears the corresponding labeling (constraints, variables, or both) of this decomposition */
166  SCIP_DECOMP* decomp, /**< decomposition data structure */
167  SCIP_Bool clearvarlabels, /**< should the variable labels be cleared? */
168  SCIP_Bool clearconslabels /**< should the constraint labels be cleared? */
169  );
170 
171 /** prints decomposition statistics into string buffer */
174  SCIP_DECOMP* decomp, /**< decomposition data structure */
175  char* strbuf /**< string buffer storage */
176  );
177 
178 /* @} */
179 
180 #ifdef __cplusplus
181 }
182 #endif
183 
184 #endif
SCIP_EXPORT int SCIPdecompGetBlockGraphMaxDegree(SCIP_DECOMP *decomp)
Definition: dcmp.c:329
SCIP_EXPORT int SCIPdecompGetNBlockGraphComponents(SCIP_DECOMP *decomp)
Definition: dcmp.c:309
SCIP_EXPORT void SCIPdecompFree(SCIP_DECOMP **decomp, BMS_BLKMEM *blkmem)
Definition: dcmp.c:89
SCIP_EXPORT SCIP_Real SCIPdecompGetModularity(SCIP_DECOMP *decomp)
Definition: dcmp.c:289
#define SCIP_EXPORT
Definition: def.h:100
SCIP_EXPORT SCIP_RETCODE SCIPdecompClear(SCIP_DECOMP *decomp, SCIP_Bool clearvarlabels, SCIP_Bool clearconslabels)
Definition: dcmp.c:214
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
SCIP_EXPORT SCIP_Bool SCIPdecompIsOriginal(SCIP_DECOMP *decomp)
Definition: dcmp.c:236
SCIP_EXPORT int SCIPdecompGetNBlockGraphEdges(SCIP_DECOMP *decomp)
Definition: dcmp.c:299
SCIP_EXPORT void SCIPdecompSetUseBendersLabels(SCIP_DECOMP *decomp, SCIP_Bool benderslabels)
Definition: dcmp.c:248
SCIP_EXPORT SCIP_RETCODE SCIPdecompCreate(SCIP_DECOMP **decomp, BMS_BLKMEM *blkmem, int nblocks, SCIP_Bool original, SCIP_Bool benderslabels)
Definition: dcmp.c:47
SCIP_EXPORT SCIP_Bool SCIPdecompUseBendersLabels(SCIP_DECOMP *decomp)
Definition: dcmp.c:259
SCIP_EXPORT void SCIPdecompGetVarsLabels(SCIP_DECOMP *decomp, SCIP_VAR **vars, int *labels, int nvars)
Definition: dcmp.c:139
#define SCIP_Bool
Definition: def.h:70
SCIP_EXPORT int SCIPdecompGetNBlocks(SCIP_DECOMP *decomp)
Definition: dcmp.c:269
SCIP_EXPORT int SCIPdecompGetBlockGraphMinDegree(SCIP_DECOMP *decomp)
Definition: dcmp.c:339
SCIP_EXPORT int SCIPdecompGetNBlockGraphArticulations(SCIP_DECOMP *decomp)
Definition: dcmp.c:319
SCIP_EXPORT SCIP_Real SCIPdecompGetAreaScore(SCIP_DECOMP *decomp)
Definition: dcmp.c:279
#define SCIP_Real
Definition: def.h:163
SCIP_EXPORT SCIP_RETCODE SCIPdecompSetVarsLabels(SCIP_DECOMP *decomp, SCIP_VAR **vars, int *labels, int nvars)
Definition: dcmp.c:114
type definitions for decompositions and the decomposition store
SCIP_EXPORT SCIP_RETCODE SCIPdecompSetConsLabels(SCIP_DECOMP *decomp, SCIP_CONS **conss, int *labels, int nconss)
Definition: dcmp.c:163
SCIP_EXPORT char * SCIPdecompPrintStats(SCIP_DECOMP *decomp, char *strbuf)
Definition: dcmp.c:349
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:429
SCIP_EXPORT void SCIPdecompGetConsLabels(SCIP_DECOMP *decomp, SCIP_CONS **conss, int *labels, int nconss)
Definition: dcmp.c:188
type definitions for constraints and constraint handlers
memory allocation routines