Scippy

SoPlex

Sequential object-oriented simPlex

spxfileio.cpp
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the class library */
4 /* SoPlex --- the Sequential object-oriented simPlex. */
5 /* */
6 /* Copyright (C) 1996-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SoPlex is distributed under the terms of the ZIB Academic Licence. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SoPlex; see the file COPYING. If not email to soplex@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 #include <assert.h>
17 
18 #include "soplex/spxdefines.h"
19 #include "soplex/spxsolver.h"
20 #include "soplex/spxfileio.h"
21 
22 namespace soplex
23 {
25  const char* filename,
26  const NameSet* rowNames,
27  const NameSet* colNames)
28 {
29 
30  spxifstream file(filename);
31 
32  if(!file)
33  return false;
34 
35  return readBasis(file, rowNames, colNames);
36 }
37 
39 (const char* filename,
40  const NameSet* rowNames,
41  const NameSet* colNames,
42  const bool cpxFormat) const
43 {
44  std::ofstream file(filename);
45 
46  if(!file)
47  return false;
48 
49  writeBasis(file, rowNames, colNames);
50 
51  return true;
52 }
53 
54 } // namespace soplex
virtual void writeBasis(std::ostream &os, const NameSet *rownames, const NameSet *colnames, const bool cpxFormat=false) const
Definition: spxbasis.cpp:640
virtual bool readBasisFile(const char *filename, const NameSet *rowNames, const NameSet *colNames)
Definition: spxfileio.cpp:24
declaration of types for file output
virtual bool readBasis(std::istream &in, const NameSet *rowNames, const NameSet *colNames)
Definition: spxbasis.cpp:412
main LP solver class
Debugging, floating point type and parameter definitions.
Set of strings.Class NameSet implements a symbol or name table. It allows to store or remove names (i...
Definition: nameset.h:61
virtual bool writeBasisFile(const char *filename, const NameSet *rowNames, const NameSet *colNames, const bool cpxFormat=false) const
Definition: spxfileio.cpp:39
Everything should be within this namespace.
std::ifstream spxifstream
Definition: spxfileio.h:43