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-2016 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 to non-binary variables y 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  * array is sorted by variable index of y
50  */
52 {
53  SCIP_VAR** vars[2]; /**< variables y in implications y <= b or y >= b */
54  SCIP_BOUNDTYPE* types[2]; /**< types of implications y <= b (SCIP_BOUNDTYPE_UPPER)
55  * or y >= b (SCIP_BOUNDTYPE_LOWER) */
56  SCIP_Real* bounds[2]; /**< bounds b in implications y <= b or y >= b */
57  int* ids[2]; /**< unique ids of implications; < 0 iff implication is a shortcut,
58  * i.e., it was added as part of the transitive closure of another implication */
59  int size[2]; /**< size of implvars, implbounds and implvals arrays for x <= 0 and x >= 1*/
60  int nimpls[2]; /**< number of all implications for x <= 0 and x >= 1 */
61 };
62 
63 /** single clique, stating that at most one of the binary variables can be fixed to the corresponding value */
65 {
66  SCIP_VAR** vars; /**< variables in the clique */
67  SCIP_Bool* values; /**< values of the variables in the clique */
68  int nvars; /**< number of variables in the clique */
69  int size; /**< size of vars and values arrays */
70  int startcleanup; /**< clean up position to start with */
71  int index; /**< the index of the clique in the cliquetable cliques array */
72  unsigned int id:30; /**< unique identifier of clique */
73  unsigned int eventsissued:1; /**< were the IMPLADDED events on the variables already issued? */
74  unsigned int equation:1; /**< is the clique an equation or an inequality? */
75 };
76 
77 /** list of cliques for a single variable */
79 {
80  SCIP_CLIQUE** cliques[2]; /**< cliques the variable fixed to FALSE/TRUE is member of */
81  int ncliques[2]; /**< number of cliques the variable fixed to FALSE/TRUE is member of */
82  int size[2]; /**< size of cliques arrays */
83 };
84 
85 /** collection of cliques */
87 {
88  SCIP_HASHTABLE* hashtable; /**< hash table holding all cliques */
89  SCIP_CLIQUE** cliques; /**< cliques stored in the table */
90  SCIP_Longint nentries; /**< number of entries in the whole clique table */
91  int ncliques; /**< number of cliques stored in the table */
92  int size; /**< size of cliques array */
93  int ncreatedcliques; /**< number of ever created cliques */
94  int ncleanupfixedvars; /**< number of fixed variables when the last cleanup was performed */
95  int ncleanupaggrvars; /**< number of aggregated variables when the last cleanup was performed */
96  int ndirtycliques; /**< number of cliques stored when the last cleanup was performed */
97  SCIP_Bool incleanup; /**< is this clique table currently performing cleanup? */
98 };
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif
SCIP_CLIQUE ** cliques
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
type definitions for implications, variable bounds, and cliques
SCIP_HASHTABLE * hashtable
SCIP_Real * constants
SCIP_Real * coefs
type definitions for LP management
SCIP_Bool incleanup
type definitions for problem variables
SCIP_VAR ** vars
SCIP_Bool * values
#define SCIP_Bool
Definition: def.h:53
SCIP_VAR ** vars
#define SCIP_Real
Definition: def.h:127
#define SCIP_Longint
Definition: def.h:112
common defines and data types used in all packages of SCIP
SCIP_Longint nentries