class_varclassifier.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-2018 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 
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35 
36 #ifndef GCG_CLASS_VARCLASSIFIER_H__
37 #define GCG_CLASS_VARCLASSIFIER_H__
38 
39 #include "class_indexclassifier.h"
40 
41 namespace gcg
42 {
43 
45 {
46  ALL = 0,
47  LINKING = 1,
48  MASTER = 2,
49  BLOCK = 3
50 };
52 
53 
55 {
56 
57 public:
58 
61  SCIP* scip,
62  const char* name,
63  int nClasses,
64  int nVars
65  );
66 
69  const VarClassifier* toCopy
70  );
71 
72 
75 
76 
78  int addClass(
79  const char* name,
80  const char* desc,
81  VAR_DECOMPINFO decompInfo
82  );
83 
85  void assignVarToClass(
86  int varindex,
87  int classindex
88  );
89 
91  std::vector<std::vector<int>> getAllSubsets(
92  bool all,
93  bool linking,
94  bool master,
95  bool block
96  );
97 
99  VAR_DECOMPINFO getClassDecompInfo(
100  int classindex
101  );
102 
104  const char* getClassNameOfVar(
105  int varindex
106  );
107 
108 
110  int getClassOfVar(
111  int varindex
112  );
113 
115  const int* getVarsToClasses(
116  );
117 
119  int getNVars(
120  );
121 
123  std::vector<int> getNVarsOfClasses(
124  );
125 
127  bool isVarClassified(
128  int varindex
129  );
130 
131 
136  int maxNumberOfClasses
137  );
138 
140  void setClassDecompInfo(
141  int classindex,
142  VAR_DECOMPINFO decompInfo
143  );
144 
145 };
146 
147 
148 } /* namespace gcg */
149 #endif /* GCG_CLASS_VARCLASSIFIER_H__ */
std::vector< int > getNVarsOfClasses()
const char * getClassNameOfVar(int varindex)
VarClassifier(SCIP *scip, const char *name, int nClasses, int nVars)
VarClassifier * reduceClasses(int maxNumberOfClasses)
void setClassDecompInfo(int classindex, VAR_DECOMPINFO decompInfo)
generalization of ConsClassifier and VarClassifier
int getClassOfVar(int varindex)
std::vector< std::vector< int > > getAllSubsets(bool all, bool linking, bool master, bool block)
enum VarClassDecompInfo VAR_DECOMPINFO
VAR_DECOMPINFO getClassDecompInfo(int classindex)
const int * getVarsToClasses()
bool isVarClassified(int varindex)
int addClass(const char *name, const char *desc, VAR_DECOMPINFO decompInfo)
void assignVarToClass(int varindex, int classindex)