Scippy

SCIP

Solving Constraint Integer Programs

struct_implics.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-2014 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 struct_implics.h
17  * @brief datastructures for implications, variable bounds, and cliques
18  * @author Tobias Achterberg
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_STRUCT_IMPLICS_H__
24 #define __SCIP_STRUCT_IMPLICS_H__
25 
26 
27 #include "scip/def.h"
28 #include "scip/type_lp.h"
29 #include "scip/type_var.h"
30 #include "scip/type_implics.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /** variable bounds of a variable x in the form x <= b*z + d or x >= b*z + d */
38 {
39  SCIP_VAR** vars; /**< variables z in variable bounds x <= b*z + d or x >= b*z + d */
40  SCIP_Real* coefs; /**< coefficients b in variable bounds x <= b*z + d or x >= b*z + d */
41  SCIP_Real* constants; /**< constants d in variable bounds x <= b*z + d or x >= b*z + d */
42  int len; /**< number of existing variable bounds (used slots in arrays) */
43  int size; /**< size of vars, coefs, and constants arrays */
44 };
45 
46 /** implications for binary variable x in the form
47  * x <= 0 ==> y <= b or y >= b (stored in arrays[0])
48  * x >= 1 ==> y <= b or y >= b (stored in arrays[1])
49  * implications with binary variable y are stored at the beginning of arrays (sorted by pointer of y)
50  * implications with nonbinary variable y are stored at the end of arrays (sorted by pointer of y)
51  */
53 {
54  SCIP_VAR** vars[2]; /**< variables y in implications y <= b or y >= b */
55  SCIP_BOUNDTYPE* types[2]; /**< types of implications y <= b (SCIP_BOUNDTYPE_UPPER)
56  * or y >= b (SCIP_BOUNDTYPE_LOWER) */
57  SCIP_Real* bounds[2]; /**< bounds b in implications y <= b or y >= b */
58  int* ids[2]; /**< unique ids of implications; < 0 iff implication is a shortcut,
59  * i.e., it was added as part of the transitive closure of another implication */
60  int size[2]; /**< size of implvars, implbounds and implvals arrays for x <= 0 and x >= 1*/
61  int nimpls[2]; /**< number of all implications for x <= 0 and x >= 1 */
62  int nbinimpls[2]; /**< number of implications with binary variable y for x <= 0 and x >= 1 */
63 };
64 
65 /** single clique, stating that at most one of the binary variables can be fixed to the corresponding value */
67 {
68  SCIP_VAR** vars; /**< variables in the clique */
69  SCIP_Bool* values; /**< values of the variables in the clique */
70  int nvars; /**< number of variables in the clique */
71  int size; /**< size of vars and values arrays */
72  unsigned int id:31; /**< unique identifier of clique */
73  unsigned int eventsissued:1; /**< were the IMPLADDED events on the variables already issued? */
74 };
75 
76 /** list of cliques for a single variable */
78 {
79  SCIP_CLIQUE** cliques[2]; /**< cliques the variable fixed to FALSE/TRUE is member of */
80  int ncliques[2]; /**< number of cliques the variable fixed to FALSE/TRUE is member of */
81  int size[2]; /**< size of cliques arrays */
82 };
83 
84 /** collection of cliques */
86 {
87  SCIP_CLIQUE** cliques; /**< cliques stored in the table */
88  int ncliques; /**< number of cliques stored in the table */
89  int size; /**< size of cliques array */
90  int ncreatedcliques; /**< number of ever created cliques */
91  int ncleanupfixedvars; /**< number of fixed variables when the last cleanup was performed */
92  int ncleanupaggrvars; /**< number of aggregated variables when the last cleanup was performed */
93  int ncleanupcliques; /**< number of cliques stored when the last cleanup was performed */
94 };
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif
101