Scippy

GCG

Branch-and-Price & Column Generation for Everyone

pub_bliss.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 pub_bliss.h
29  * @ingroup PUBLICCOREAPI
30  * @brief helper functions for automorphism detection
31  *
32  * @author Martin Bergner
33  * @author Daniel Peters
34  * @author Jonas Witt
35  *
36  */
37 
38 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39 
40 #ifndef PUB_BLISS_H_
41 #define PUB_BLISS_H_
42 
43 #include "scip/scip.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 
50 typedef struct struct_cons AUT_CONS;
51 typedef struct struct_var AUT_VAR;
52 typedef struct struct_coef AUT_COEF;
53 typedef struct struct_colorinformation AUT_COLOR;
54 /**
55 * @ingroup BLISS
56 * @{
57  */
58 
59 /** returns bliss version */
60 extern
61 void GCGgetBlissName(char* buffer, int len);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #ifdef __cplusplus
68 /** saves a constraint with its corresponding scip */
69 struct struct_cons
70 {
71  SCIP* scip; /**< SCIP data structure */
72  SCIP_CONS* cons; /**< pointer to SCIP constraint */
73 
74  /** constructor for the constraint struct */
75  struct_cons( SCIP* scip, SCIP_CONS* scons );
76 
77  /** getter for the SCIP constraint */
78  SCIP_CONS* getCons();
79 
80  /** getter for the SCIP itself */
81  SCIP* getScip();
82 };
83 
84 /** saves a variable with its corresponding scip */
85 struct struct_var
86 {
87  SCIP* scip; /**< SCIP data structure */
88  SCIP_VAR* var; /**< pointer to SCIP variable */
89 
90  /** constructor for the variable struct */
91  struct_var( SCIP* scip, SCIP_VAR* svar );
92 
93  /** getter for the SCIP variable */
94  SCIP_VAR* getVar();
95 
96  /** getter for the SCIP itself */
97  SCIP* getScip();
98 };
99 
100 /** saves a coefficient with its corresponding scip */
101 struct struct_coef
102 {
103  SCIP* scip; /**< SCIP data structure */
104  SCIP_Real val; /**< SCIP Real value */
105 
106  /** constructor for the coefficient struct */
107  struct_coef( SCIP* scip, SCIP_Real val );
108 
109  /** getter for the SCIP Real value */
110  SCIP_Real getVal();
111 
112  /** getter for the SCIP itself */
113  SCIP* getScip();
114 };
115 
116 /** saves helping information for creating the graph */
117 struct struct_colorinformation
118 {
119  int color; /**< color of the nodes of the graph */
120  int lenconssarray; /**< size of ptrarrayconss */
121  int lenvarsarray; /**< size of ptrarrayvars */
122  int lencoefsarray; /**< size of ptrarraycoefs */
123  int alloccoefsarray; /**< allocated size of ptrarraycoefs */
124 
125  void** ptrarraycoefs; /**< array of pointers to coefficient */
126  void** ptrarrayvars; /**< array of pointers to variables */
127  void** ptrarrayconss; /**< array of pointers to constraints */
128 
129  SCIP_Bool onlysign; /**< use sign of values instead of values? (should be FALSE if we check whether pricin problems can be aggregated) */
130 
131  /** default constructor */
132  struct_colorinformation();
133 
134  /** insert a variable to its pointer array */
135  SCIP_RETCODE insert( AUT_VAR* svar, SCIP_Bool* added);
136 
137  /** insert a constraint to its pointer array */
138  SCIP_RETCODE insert( AUT_CONS* scons, SCIP_Bool* added);
139 
140  /** insert a coefficient to its pointer array */
141  SCIP_RETCODE insert( AUT_COEF* scoef, SCIP_Bool* added);
142 
143  /** getter for the length of the variable array */
144  int getLenVar();
145 
146  /** getter for the length of the constraint array */
147  int getLenCons();
148 
149  /** getter for the variable struct */
150  int get( AUT_VAR svar);
151 
152  /** getter for the constraint struct */
153  int get( AUT_CONS scons);
154 
155  /** getter for the coefficient struct */
156  int get( AUT_COEF scoef);
157 
158  /** set onlysign bool */
159  SCIP_RETCODE setOnlySign(SCIP_Bool onlysign_);
160 
161  /** get onlysign bool */
162  SCIP_Bool getOnlySign();
163 };
164 
165 
166 #endif
167 /** @} */
168 #endif /* PUB_BLISS_H_ */
struct struct_cons AUT_CONS
Definition: pub_bliss.h:50
void GCGgetBlissName(char *buffer, int len)
struct struct_colorinformation AUT_COLOR
Definition: pub_bliss.h:53
struct struct_coef AUT_COEF
Definition: pub_bliss.h:52
struct struct_var AUT_VAR
Definition: pub_bliss.h:51