SCIP-SDP  2.0.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-2015 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-2015 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 
38 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39 
40 #ifndef __SCIP_OBJREADER_SDPA_H__
41 #define __SCIP_OBJREADER_SDPA_H__
42 
43 #include <utility> // for pair
44 #include <vector> // for vector
45 
46 #include "objscip/objreader.h" // for ObjReader
47 #include "scip/scip.h"
48 
49 class SdpProblem;
50 class SdpVarMapper;
51 
52 namespace scip
53 {
55  struct LProw
56  {
57  std::vector< std::pair<int, double> > data;
58  };
60  class SDPBlock
61  {
62  public:
63  SDPBlock (int size) : blocksize(size), num_nonzeros(0), constnum_nonzeros(0) { }
64  ~SDPBlock() {}
65 
66  int blocksize;
68  std::vector<int> variables;
69  std::vector<int> columns;
70  std::vector<int> rows;
71  std::vector<double> values;
72 
73  std::vector<int> constcolumns;
74  std::vector<int> constrows;
75  std::vector<double> constvalues;
77  };
78 
80  class LPBlock
81  {
82  public:
83  LPBlock(): numrows(0) { }
84  ~LPBlock() {}
85 
86  int numrows;
87  std::vector<LProw> rows;
88  };
89 
91  class ObjReaderSDPA : public ObjReader
92  {
93  public:
94 
96  ObjReaderSDPA(SCIP* scip)
97  : ObjReader(scip, "sdpareader", "file reader for SDPA files", "dat-s")
98  {}
99 
101  virtual ~ObjReaderSDPA()
102  {}
103 
112  virtual SCIP_RETCODE scip_read(
113  SCIP* scip,
114  SCIP_READER* reader,
115  const char* filename,
116  SCIP_RESULT* result
117  );
118 
119  };
120 
121 } /* namespace scip */
122 
123 
124 #endif
std::vector< int > constcolumns
ObjReaderSDPA(SCIP *scip)
std::vector< LProw > rows
std::vector< double > constvalues
std::vector< int > constrows
std::vector< int > columns
std::vector< int > rows
std::vector< int > variables
virtual SCIP_RETCODE scip_read(SCIP *scip, SCIP_READER *reader, const char *filename, SCIP_RESULT *result)
std::vector< std::pair< int, double > > data
std::vector< double > values
SDPBlock(int size)