Scippy

SCIP

Solving Constraint Integer Programs

pub_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-2021 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 visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file pub_implics.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for implications, variable bounds, and cliques
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_PUB_IMPLICS_H__
25 #define __SCIP_PUB_IMPLICS_H__
26 
27 
28 #include "scip/def.h"
29 #include "scip/type_var.h"
30 #include "scip/type_implics.h"
31 
32 #ifdef NDEBUG
33 #include "scip/struct_implics.h"
34 #endif
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * methods for cliques
42  */
43 
44 /** returns the position of the given variable/value pair in the clique; returns -1 if variable/value pair is not member
45  * of the clique
46  */
49  SCIP_CLIQUE* clique, /**< clique data structure */
50  SCIP_VAR* var, /**< variable to search for */
51  SCIP_Bool value /**< value of the variable in the clique */
52  );
53 
54 /** returns whether the given variable/value pair is member of the given clique */
57  SCIP_CLIQUE* clique, /**< clique data structure */
58  SCIP_VAR* var, /**< variable to remove from the clique */
59  SCIP_Bool value /**< value of the variable in the clique */
60  );
61 
62 /** gets number of variables in the cliques */
65  SCIP_CLIQUE* clique /**< clique data structure */
66  );
67 
68 /** gets array of active problem variables in the cliques */
71  SCIP_CLIQUE* clique /**< clique data structure */
72  );
73 
74 /** gets array of values of active problem variables in the cliques, i.e. whether the variable is fixed to FALSE or
75  * to TRUE in the clique
76  */
79  SCIP_CLIQUE* clique /**< clique data structure */
80  );
81 
82 /** gets unique identifier of the clique */
84 unsigned int SCIPcliqueGetId(
85  SCIP_CLIQUE* clique /**< clique data structure */
86  );
87 
88 /** gets index of the clique in the clique table */
91  SCIP_CLIQUE* clique /**< clique data structure */
92  );
93 
94 /** returns whether the given clique is cleaned up */
97  SCIP_CLIQUE* clique /**< clique data structure */
98  );
99 
100 /** return whether the given clique is an equation */
103  SCIP_CLIQUE* clique /**< clique data structure */
104  );
105 
106 
107 #ifdef NDEBUG
108 
109 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
110  * speed up the algorithms.
111  */
112 
113 #define SCIPcliqueGetNVars(clique) ((clique)->nvars)
114 #define SCIPcliqueGetVars(clique) ((clique)->vars)
115 #define SCIPcliqueGetValues(clique) ((clique)->values)
116 #define SCIPcliqueGetId(clique) ((clique)->id)
117 #define SCIPcliqueGetIndex(clique) ((clique)->index)
118 #define SCIPcliqueIsCleanedUp(clique) ((clique)->startcleanup == -1)
119 #define SCIPcliqueIsEquation(clique) ((SCIP_Bool)(clique)->equation)
120 
121 #endif
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif
SCIP_EXPORT int SCIPcliqueGetIndex(SCIP_CLIQUE *clique)
Definition: implics.c:3387
type definitions for implications, variable bounds, and cliques
SCIP_EXPORT unsigned int SCIPcliqueGetId(SCIP_CLIQUE *clique)
Definition: implics.c:3373
#define SCIP_EXPORT
Definition: def.h:100
SCIP_EXPORT int SCIPcliqueSearchVar(SCIP_CLIQUE *clique, SCIP_VAR *var, SCIP_Bool value)
Definition: implics.c:1055
SCIP_EXPORT SCIP_VAR ** SCIPcliqueGetVars(SCIP_CLIQUE *clique)
Definition: implics.c:3351
SCIP_EXPORT SCIP_Bool * SCIPcliqueGetValues(SCIP_CLIQUE *clique)
Definition: implics.c:3363
SCIP_EXPORT SCIP_Bool SCIPcliqueIsEquation(SCIP_CLIQUE *clique)
Definition: implics.c:3407
type definitions for problem variables
datastructures for implications, variable bounds, and cliques
#define SCIP_Bool
Definition: def.h:70
SCIP_EXPORT int SCIPcliqueGetNVars(SCIP_CLIQUE *clique)
Definition: implics.c:3341
SCIP_EXPORT SCIP_Bool SCIPcliqueHasVar(SCIP_CLIQUE *clique, SCIP_VAR *var, SCIP_Bool value)
Definition: implics.c:1115
common defines and data types used in all packages of SCIP
SCIP_EXPORT SCIP_Bool SCIPcliqueIsCleanedUp(SCIP_CLIQUE *clique)
Definition: implics.c:3397