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-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 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  */
47 SCIP_EXPORT
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 */
55 SCIP_EXPORT
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 */
63 SCIP_EXPORT
65  SCIP_CLIQUE* clique /**< clique data structure */
66  );
67 
68 /** gets array of active problem variables in the cliques */
69 SCIP_EXPORT
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  */
77 SCIP_EXPORT
79  SCIP_CLIQUE* clique /**< clique data structure */
80  );
81 
82 /** gets unique identifier of the clique */
83 SCIP_EXPORT
84 unsigned int SCIPcliqueGetId(
85  SCIP_CLIQUE* clique /**< clique data structure */
86  );
87 
88 /** gets index of the clique in the clique table */
89 SCIP_EXPORT
91  SCIP_CLIQUE* clique /**< clique data structure */
92  );
93 
94 /** returns whether the given clique is cleaned up */
95 SCIP_EXPORT
97  SCIP_CLIQUE* clique /**< clique data structure */
98  );
99 
100 /** return whether the given clique is an equation */
101 SCIP_EXPORT
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
type definitions for implications, variable bounds, and cliques
SCIP_VAR ** SCIPcliqueGetVars(SCIP_CLIQUE *clique)
Definition: implics.c:3368
int SCIPcliqueGetNVars(SCIP_CLIQUE *clique)
Definition: implics.c:3358
unsigned int SCIPcliqueGetId(SCIP_CLIQUE *clique)
Definition: implics.c:3390
SCIP_Bool SCIPcliqueHasVar(SCIP_CLIQUE *clique, SCIP_VAR *var, SCIP_Bool value)
Definition: implics.c:1132
type definitions for problem variables
int SCIPcliqueGetIndex(SCIP_CLIQUE *clique)
Definition: implics.c:3404
datastructures for implications, variable bounds, and cliques
#define SCIP_Bool
Definition: def.h:84
SCIP_Bool SCIPcliqueIsCleanedUp(SCIP_CLIQUE *clique)
Definition: implics.c:3414
SCIP_Bool SCIPcliqueIsEquation(SCIP_CLIQUE *clique)
Definition: implics.c:3424
int SCIPcliqueSearchVar(SCIP_CLIQUE *clique, SCIP_VAR *var, SCIP_Bool value)
Definition: implics.c:1072
common defines and data types used in all packages of SCIP
SCIP_Bool * SCIPcliqueGetValues(SCIP_CLIQUE *clique)
Definition: implics.c:3380