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 and library */
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-2026 Operations Research, RWTH Aachen University */
10/* Zuse Institute Berlin (ZIB) */
11/* */
12/* Licensed under the Apache License, Version 2.0 (the "License"); */
13/* you may not use this file except in compliance with the License. */
14/* You may obtain a copy of the License at */
15/* */
16/* http://www.apache.org/licenses/LICENSE-2.0 */
17/* */
18/* Unless required by applicable law or agreed to in writing, software */
19/* distributed under the License is distributed on an "AS IS" BASIS, */
20/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
21/* See the License for the specific language governing permissions and */
22/* limitations under the License. */
23/* */
24/* You should have received a copy of the Apache-2.0 license */
25/* along with GCG; see the file LICENSE. If not visit gcg.or.rwth-aachen.de.*/
26/* */
27/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28
29/**@file scip_misc.h
30 * @brief various SCIP helper methods
31 * @author Martin Bergner
32 */
33
34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35
36#ifndef GCG_SCIP_MISC_H__
37#define GCG_SCIP_MISC_H__
38
39#include "scip/scip.h"
40#include "scip/cons_setppc.h"
41#include "gcg/gcg.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47
48/** constraint types */
49typedef enum {
53
54/**@defgroup MISC Miscellaneous
55* @ingroup PUBLICCOREAPI
56* @{
57 */
58
59/** returns TRUE if variable is relevant, FALSE otherwise */
62 SCIP_VAR* var /**< variable to test */
63 );
64
65/** returns the type of an arbitrary SCIP constraint */
68 SCIP* scip, /**< SCIP data structure the cons belongs to */
69 SCIP_CONS* cons /**< constraint to get type for */
70 );
71
72/** returns the rhs of an arbitrary SCIP constraint */
75 SCIP* scip, /**< SCIP data structure the cons belongs to */
76 SCIP_CONS* cons /**< constraint to get left hand side for */
77 );
78
79/** returns the lhs of an arbitrary SCIP constraint */
82 SCIP* scip, /**< SCIP data structure the cons belongs to */
83 SCIP_CONS* cons /**< constraint to get left hand side for */
84 );
85
86/** returns the dual farkas sol of an arbitrary SCIP constraint */
89 SCIP* scip, /**< SCIP data structure the cons belongs to */
90 SCIP_CONS* cons /**< constraint to get left hand side for */
91 );
92
93/** returns the dual sol of an arbitrary SCIP constraint */
96 SCIP* scip, /**< SCIP data structure the cons belongs to */
97 SCIP_CONS* cons /**< constraint to get left hand side for */
98 );
99
100/** returns the number of variables in an arbitrary SCIP constraint */
103 SCIP* scip, /**< SCIP data structure the cons belongs to */
104 SCIP_CONS* cons /**< constraint to get number of variables */
105 );
106
107/** returns the variable array of an arbitrary SCIP constraint */
110 SCIP* scip, /**< SCIP data structure the cons belongs to */
111 SCIP_CONS* cons, /**< constraint to get variables from */
112 SCIP_VAR** vars, /**< array where variables are stored */
113 int nvars /**< size of storage array */
114 );
115
116/** returns the value array of an arbitrary SCIP constraint */
119 SCIP* scip, /**< SCIP data structure the cons belongs to */
120 SCIP_CONS* cons, /**< constraint to get values from */
121 SCIP_Real* vals, /**< array where values are stored */
122 int nvals /**< size of storage array */
123 );
124
125/** returns true if the constraint should be a master constraint and false otherwise */
127 SCIP* scip, /**< SCIP data structure the cons belongs to */
128 SCIP_CONS* cons /**< constraint to check */
129);
130
131/** returns true if the constraint should be a master constraint and false otherwise */
133 SCIP* scip, /**< SCIP data structure the cons belongs to */
134 SCIP_CONS* cons, /**< constraint to check */
135 SCIP_SETPPCTYPE* setppctype /**< returns the type of the constraints */
136 );
137
139 SCIP* scip, /**< SCIP data structure the cons belongs to */
140 SCIP_CONS* cons /**< constraint to check */
141);
142
143/** returns TRUE or FALSE, depending whether we are in the root node or not */
146 GCG* gcg /**< SCIP data structure */
147 );
148
151 GCG* gcg
152 );
153
154/**@} */
155#ifdef __cplusplus
156}
157#endif
158
159#endif /* GCG_SCIP_MISC_H_ */
#define GCG_EXPORT
Definition: def.h:59
#define SCIP_Bool
#define SCIP_Real
GCG interface methods.
enum SCIP_SetppcType SCIP_SETPPCTYPE
GCG_EXPORT SCIP_Bool GCGisRootNode(GCG *gcg)
Definition: scip_misc.c:918
GCG_EXPORT SCIP_Bool GCGisVarRelevant(SCIP_VAR *var)
Definition: scip_misc.c:42
SCIP_Bool GCGconsIsRanged(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:741
GCG_EXPORT SCIP_RETCODE GCGincludeDialogsGraph(GCG *gcg)
GCG_EXPORT SCIP_Real GCGconsGetRhs(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:109
SCIP_Bool GCGgetConsIsCardinalityCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:846
GCG_EXPORT consType GCGconsGetType(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:52
GCG_EXPORT SCIP_Real GCGconsGetDualsol(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:367
GCG_EXPORT SCIP_Real GCGconsGetDualfarkas(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:303
SCIP_Bool GCGgetConsIsSetppc(SCIP *scip, SCIP_CONS *cons, SCIP_SETPPCTYPE *setppctype)
Definition: scip_misc.c:760
GCG_EXPORT SCIP_RETCODE GCGconsGetVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int nvars)
Definition: scip_misc.c:487
GCG_EXPORT SCIP_Real GCGconsGetLhs(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:207
GCG_EXPORT SCIP_RETCODE GCGconsGetVals(SCIP *scip, SCIP_CONS *cons, SCIP_Real *vals, int nvals)
Definition: scip_misc.c:618
GCG_EXPORT int GCGconsGetNVars(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:433
consType
Definition: scip_misc.h:49
@ setcovering
Definition: scip_misc.h:50
@ indicator
Definition: scip_misc.h:51
@ nconsTypeItems
Definition: scip_misc.h:51
@ linear
Definition: scip_misc.h:50
@ unknown
Definition: scip_misc.h:51
@ sos2
Definition: scip_misc.h:51
@ sos1
Definition: scip_misc.h:51
@ varbound
Definition: scip_misc.h:50
@ setpartitioning
Definition: scip_misc.h:50
@ setpacking
Definition: scip_misc.h:50
@ logicor
Definition: scip_misc.h:51
@ knapsack
Definition: scip_misc.h:50
Definition: struct_gcg.h:55
enum SCIP_Retcode SCIP_RETCODE