hyperrowcolgraph.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 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #ifndef GCG_HYPERROWCOLGRAPH_H_
36 #define GCG_HYPERROWCOLGRAPH_H_
37 
38 #include "matrixgraph.h"
39 #include "hypergraph.h"
40 #include "class_seeed.h"
41 #include "class_seeedpool.h"
42 
43 namespace gcg {
44 template <class T>
45 class HyperrowcolGraph: public MatrixGraph<T>
46 {
47 private:
48  Graph<T> graph;
49 public:
51  SCIP* scip,
52  Weights w
53  );
54  virtual ~HyperrowcolGraph();
55 
56  SCIP_RETCODE createFromMatrix(
57  SCIP_CONS** conss,
58  SCIP_VAR** vars,
59  int nconss,
60  int nvars
61  );
62 
64  virtual SCIP_RETCODE createFromPartialMatrix(
65  Seeedpool* seeedpool,
66  Seeed* seeed
67  );
68 
72  virtual SCIP_RETCODE writeToFile(
73  int fd,
74  SCIP_Bool writeweights
75  );
76 
77 
78  virtual SCIP_RETCODE createDecompFromPartition(
79  DEC_DECOMP** decomp
80  );
81 
83  virtual SCIP_RETCODE createSeeedFromPartition(
84  Seeed** firstSeeed,
85  Seeed** secondSeeed,
86  Seeedpool* seeedpool
87  );
88 
90  virtual SCIP_RETCODE createSeeedFromPartition(
91  Seeed* oldSeeed,
92  Seeed** firstSeeed,
93  Seeed** secondSeeed,
94  Seeedpool* seeedpool
95  );
96 
101  virtual SCIP_RETCODE readPartition(
102  const char* filename
103  );
104 
105  virtual std::vector<int> getNeighbors(
106  int i
107  );
108 
109  virtual std::vector<int> getHyperedgeNodes(
110  int i
111  );
112 
113  std::vector<int> getConsNonzeroNodes(
114  int i
115  );
116 
117  std::vector<int> getVarNonzeroNodes(
118  int i
119  );
120 
121 };
122 
123 } /* namespace gcg */
124 #endif /* GCG_HYPERROWCOLGRAPH_H_ */
miscellaneous matrixgraph methods for structure detection
miscellaneous hypergraph methods for structure detection
virtual SCIP_RETCODE writeToFile(int fd, SCIP_Bool writeweights)
virtual SCIP_RETCODE createSeeedFromPartition(Seeed **firstSeeed, Seeed **secondSeeed, Seeedpool *seeedpool)
virtual SCIP_RETCODE readPartition(const char *filename)
std::vector< int > getConsNonzeroNodes(int i)
class to manage partial decompositions (aka seeed), each seeed corresponds to one seeedpool which con...
Definition: class_seeed.h:71
virtual SCIP_RETCODE createDecompFromPartition(DEC_DECOMP **decomp)
std::vector< int > getVarNonzeroNodes(int i)
virtual std::vector< int > getHyperedgeNodes(int i)
virtual std::vector< int > getNeighbors(int i)
HyperrowcolGraph(SCIP *scip, Weights w)
class with functions for seeed pool where a seeed is a (potentially incomplete) description of a deco...
SCIP_RETCODE createFromMatrix(SCIP_CONS **conss, SCIP_VAR **vars, int nconss, int nvars)
virtual SCIP_RETCODE createFromPartialMatrix(Seeedpool *seeedpool, Seeed *seeed)
struct DecDecomp DEC_DECOMP
Definition: type_decomp.h:43