SCIP-SDP  3.2.0
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 programs based on SCIP. */
5 /* */
6 /* Copyright (C) 2011-2013 Discrete Optimization, TU Darmstadt */
7 /* EDOM, FAU Erlangen-Nürnberg */
8 /* 2014-2020 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-2020 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 namespace scip
51 {
53  struct LProw
54  {
55  std::vector< std::pair<int, SCIP_Real> > data;
56  };
57 
59  class SDPBlock
60  {
61  public:
62  SDPBlock(int size) : blocksize(size), num_nonzeros(0), constnum_nonzeros(0) { }
63  ~SDPBlock() {}
64 
65  int blocksize;
67  std::vector<int> variables;
68  std::vector<int> columns;
69  std::vector<int> rows;
70  std::vector<SCIP_Real> values;
71 
72  std::vector<int> constcolumns;
73  std::vector<int> constrows;
74  std::vector<SCIP_Real> constvalues;
76  };
77 
79  class LPBlock
80  {
81  public:
82  LPBlock(): numrows(0) { }
83  ~LPBlock() {}
84 
85  int numrows;
86  std::vector<LProw> rows;
87  };
88 
90  class ObjReaderSDPA : public ObjReader
91  {
92  public:
93 
96  : ObjReader(scip, "sdpareader", "file reader for SDPA files", "dat-s")
97  {}
98 
100  virtual ~ObjReaderSDPA()
101  {}
102 
111  virtual SCIP_DECL_READERREAD(scip_read);
112 
113  };
114 
115 } /* namespace scip */
116 
117 
118 #endif
std::vector< int > constcolumns
std::vector< SCIP_Real > constvalues
SCIP_DECL_READERREAD(ObjReaderSDPA::scip_read)
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
std::vector< SCIP_Real > values
SDPBlock(int size)