graph_interface.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 
37 
38 #ifndef GCG_GRAPHINTERFACE_H_
39 #define GCG_GRAPHINTERFACE_H_
40 
41 #include "objscip/objscip.h"
42 #include "weights.h"
43 
44 #include <vector>
45 #include <fstream>
46 
47 using std::ifstream;
48 namespace gcg {
49 
51 protected:
52  std::vector<int> partition;
53 public:
54 
56 
57  virtual ~GraphInterface() {}
58 
60  virtual std::vector<int> getPartition() const { return partition; }
61 
63  virtual void setPartition(int i, int nodeid) = 0;
64 
68  virtual SCIP_RETCODE writeToFile(
69  int fd,
70  SCIP_Bool writeweights
71  ) = 0;
72 
73 
78  virtual SCIP_RETCODE readPartition(
79  const char* filename
80  ) = 0;
81 
82 
84  virtual SCIP_RETCODE createDecompFromPartition(
85  DEC_DECOMP** decomp
86  )
87  { /*lint -e715*/
88  return SCIP_ERROR;
89  }
90 
91  virtual SCIP_RETCODE flush() = 0;
92 
93 };
94 
95 }
96 
97 #endif
virtual std::vector< int > getPartition() const
virtual SCIP_RETCODE createDecompFromPartition(DEC_DECOMP **decomp)
weight class for graphs
virtual SCIP_RETCODE flush()=0
virtual void setPartition(int i, int nodeid)=0
std::vector< int > partition
struct DecDecomp DEC_DECOMP
Definition: type_decomp.h:43
virtual SCIP_RETCODE readPartition(const char *filename)=0
virtual SCIP_RETCODE writeToFile(int fd, SCIP_Bool writeweights)=0