SCIP-SDP  2.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
objreader_sdpa.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of SCIPSDP - a solving framework for mixed-integer */
4 /* semidefinite programms based on SCIP. */
5 /* */
6 /* Copyright (C) 2011-2013 Discrete Optimization, TU Darmstadt */
7 /* EDOM, FAU Erlangen-Nürnberg */
8 /* 2014-2016 Discrete Optimization, TU Darmstadt */
9 /* */
10 /* */
11 /* This program is free software; you can redistribute it and/or */
12 /* modify it under the terms of the GNU Lesser General Public License */
13 /* as published by the Free Software Foundation; either version 3 */
14 /* of the License, or (at your option) any later version. */
15 /* */
16 /* This program is distributed in the hope that it will be useful, */
17 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
18 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
19 /* GNU Lesser General Public License for more details. */
20 /* */
21 /* You should have received a copy of the GNU Lesser General Public License */
22 /* along with this program; if not, write to the Free Software */
23 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.*/
24 /* */
25 /* */
26 /* Based on SCIP - Solving Constraint Integer Programs */
27 /* Copyright (C) 2002-2016 Zuse Institute Berlin */
28 /* SCIP is distributed under the terms of the SCIP Academic Licence, */
29 /* see file COPYING in the SCIP distribution. */
30 /* */
31 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
32 
39 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
40 
41 #ifndef __SCIP_OBJREADER_SDPA_H__
42 #define __SCIP_OBJREADER_SDPA_H__
43 
44 #include <utility> // for pair
45 #include <vector> // for vector
46 
47 #include "objscip/objreader.h" // for ObjReader
48 #include "scip/scip.h"
49 
50 class SdpProblem;
51 class SdpVarMapper;
52 
53 namespace scip
54 {
56  struct LProw
57  {
58  std::vector< std::pair<int, SCIP_Real> > data;
59  };
60 
62  class SDPBlock
63  {
64  public:
65  SDPBlock (int size) : blocksize(size), num_nonzeros(0), constnum_nonzeros(0) { }
66  ~SDPBlock() {}
67 
68  int blocksize;
70  std::vector<int> variables;
71  std::vector<int> columns;
72  std::vector<int> rows;
73  std::vector<SCIP_Real> values;
74 
75  std::vector<int> constcolumns;
76  std::vector<int> constrows;
77  std::vector<SCIP_Real> constvalues;
79  };
80 
82  class LPBlock
83  {
84  public:
85  LPBlock(): numrows(0) { }
86  ~LPBlock() {}
87 
88  int numrows;
89  std::vector<LProw> rows;
90  };
91 
93  class ObjReaderSDPA : public ObjReader
94  {
95  public:
96 
98  ObjReaderSDPA(SCIP* scip)
99  : ObjReader(scip, "sdpareader", "file reader for SDPA files", "dat-s")
100  {}
101 
103  virtual ~ObjReaderSDPA()
104  {}
105 
114  virtual SCIP_RETCODE scip_read(
115  SCIP* scip,
116  SCIP_READER* reader,
117  const char* filename,
118  SCIP_RESULT* result
119  );
120 
121  };
122 
123 } /* namespace scip */
124 
125 
126 #endif
std::vector< int > constcolumns
std::vector< SCIP_Real > constvalues
ObjReaderSDPA(SCIP *scip)
std::vector< LProw > rows
std::vector< int > constrows
std::vector< int > columns
std::vector< int > rows
std::vector< std::pair< int, SCIP_Real > > data
std::vector< int > variables
virtual SCIP_RETCODE scip_read(SCIP *scip, SCIP_READER *reader, const char *filename, SCIP_RESULT *result)
std::vector< SCIP_Real > values
SDPBlock(int size)