Scippy

GCG

Branch-and-Price & Column Generation for Everyone

scip_misc.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program */
4 /* GCG --- Generic Column Generation */
5 /* a Dantzig-Wolfe decomposition based extension */
6 /* of the branch-cut-and-price framework */
7 /* SCIP --- Solving Constraint Integer Programs */
8 /* */
9 /* Copyright (C) 2010-2021 Operations Research, RWTH Aachen University */
10 /* Zuse Institute Berlin (ZIB) */
11 /* */
12 /* This program is free software; you can redistribute it and/or */
13 /* modify it under the terms of the GNU Lesser General Public License */
14 /* as published by the Free Software Foundation; either version 3 */
15 /* of the License, or (at your option) any later version. */
16 /* */
17 /* This program is distributed in the hope that it will be useful, */
18 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
19 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
20 /* GNU Lesser General Public License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with this program; if not, write to the Free Software */
24 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.*/
25 /* */
26 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
27 
28 /**@file scip_misc.h
29  * @brief various SCIP helper methods
30  * @author Martin Bergner
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #ifndef GCG_SCIP_MISC_H__
36 #define GCG_SCIP_MISC_H__
37 
38 #include "scip/scip.h"
39 #include "scip/cons_setppc.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 
46 /** constraint types */
47 typedef enum {
50 } consType;
51 
52 /**@defgroup MISC Miscellaneous
53 * @ingroup PUBLICCOREAPI
54 * @{
55  */
56 
57 /** returns TRUE if variable is relevant, FALSE otherwise */
58 extern
59 SCIP_Bool GCGisVarRelevant(
60  SCIP_VAR* var /**< variable to test */
61  );
62 
63 /** returns the type of an arbitrary SCIP constraint */
64 extern
66  SCIP* scip, /**< SCIP data structure */
67  SCIP_CONS* cons /**< constraint to get type for */
68  );
69 
70 /** returns the rhs of an arbitrary SCIP constraint */
71 extern
72 SCIP_Real GCGconsGetRhs(
73  SCIP* scip, /**< SCIP data structure */
74  SCIP_CONS* cons /**< constraint to get left hand side for */
75  );
76 
77 /** returns the lhs of an arbitrary SCIP constraint */
78 extern
79 SCIP_Real GCGconsGetLhs(
80  SCIP* scip, /**< SCIP data structure */
81  SCIP_CONS* cons /**< constraint to get left hand side for */
82  );
83 
84 /** returns the dual farkas sol of an arbitrary SCIP constraint */
85 extern
86 SCIP_Real GCGconsGetDualfarkas(
87  SCIP* scip, /**< SCIP data structure */
88  SCIP_CONS* cons /**< constraint to get left hand side for */
89  );
90 
91 /** returns the dual sol of an arbitrary SCIP constraint */
92 extern
93 SCIP_Real GCGconsGetDualsol(
94  SCIP* scip, /**< SCIP data structure */
95  SCIP_CONS* cons /**< constraint to get left hand side for */
96  );
97 
98 /** returns the number of variables in an arbitrary SCIP constraint */
99 extern
100 int GCGconsGetNVars(
101  SCIP* scip, /**< SCIP data structure */
102  SCIP_CONS* cons /**< constraint to get number of variables */
103  );
104 
105 /** returns the variable array of an arbitrary SCIP constraint */
106 extern
107 SCIP_RETCODE GCGconsGetVars(
108  SCIP* scip, /**< SCIP data structure */
109  SCIP_CONS* cons, /**< constraint to get variables from */
110  SCIP_VAR** vars, /**< array where variables are stored */
111  int nvars /**< size of storage array */
112  );
113 
114 /** returns the value array of an arbitrary SCIP constraint */
115 extern
116 SCIP_RETCODE GCGconsGetVals(
117  SCIP* scip, /**< SCIP data structure */
118  SCIP_CONS* cons, /**< constraint to get values from */
119  SCIP_Real* vals, /**< array where values are stored */
120  int nvals /**< size of storage array */
121  );
122 
123 /** returns true if the constraint should be a master constraint and false otherwise */
124 SCIP_Bool GCGconsIsRanged(
125  SCIP* scip, /**< SCIP data structure */
126  SCIP_CONS* cons /**< constraint to check */
127 );
128 
129 /** returns true if the constraint should be a master constraint and false otherwise */
130 SCIP_Bool GCGgetConsIsSetppc(
131  SCIP* scip, /**< SCIP data structure */
132  SCIP_CONS* cons, /**< constraint to check */
133  SCIP_SETPPCTYPE* setppctype /**< returns the type of the constraints */
134  );
135 
137  SCIP* scip, /**< SCIP data structure */
138  SCIP_CONS* cons /**< constraint to check */
139 );
140 
141 
142 /** returns TRUE or FALSE, depending whether we are in the root node or not */
143 extern
144 SCIP_Bool GCGisRootNode(
145  SCIP* scip /**< SCIP data structure */
146  );
147 
148 extern
149 SCIP_RETCODE GCGincludeDialogsGraph(
150  SCIP* scip
151  );
152 
153 /**@} */
154 #ifdef __cplusplus
155 }
156 #endif
157 
158 #endif /* GCG_SCIP_MISC_H_ */
SCIP_Real GCGconsGetRhs(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:108
SCIP_Real GCGconsGetLhs(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:206
@ logicor
Definition: scip_misc.h:49
SCIP_Real GCGconsGetDualfarkas(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:303
SCIP_Bool GCGgetConsIsCardinalityCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:849
@ sos2
Definition: scip_misc.h:49
@ knapsack
Definition: scip_misc.h:48
@ indicator
Definition: scip_misc.h:49
SCIP_Real GCGconsGetDualsol(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:368
SCIP_RETCODE GCGconsGetVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int nvars)
Definition: scip_misc.c:490
SCIP_Bool GCGisVarRelevant(SCIP_VAR *var)
Definition: scip_misc.c:41
SCIP_Bool GCGconsIsRanged(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:744
@ sos1
Definition: scip_misc.h:49
@ nconsTypeItems
Definition: scip_misc.h:49
SCIP_RETCODE GCGincludeDialogsGraph(SCIP *scip)
@ setpacking
Definition: scip_misc.h:48
@ setpartitioning
Definition: scip_misc.h:48
consType GCGconsGetType(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:51
SCIP_RETCODE GCGconsGetVals(SCIP *scip, SCIP_CONS *cons, SCIP_Real *vals, int nvals)
Definition: scip_misc.c:621
SCIP_Bool GCGisRootNode(SCIP *scip)
Definition: scip_misc.c:921
int GCGconsGetNVars(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:434
SCIP_Bool GCGgetConsIsSetppc(SCIP *scip, SCIP_CONS *cons, SCIP_SETPPCTYPE *setppctype)
Definition: scip_misc.c:763
@ linear
Definition: scip_misc.h:48
consType
Definition: scip_misc.h:47
@ setcovering
Definition: scip_misc.h:48
@ unknown
Definition: scip_misc.h:49
@ varbound
Definition: scip_misc.h:48