OS  2.10.1
OSCsdpSolver.h
Go to the documentation of this file.
1 /* $Id: OSCsdpSolver.h 4562 2013-01-02 12:31:12Z Gassmann $ */
15 #ifndef CSDPSOLVER_H
16 #define CSDPSOLVER_H
17 
18 #include "OSConfig.h"
19 #include "OSDefaultSolver.h"
20 #include "OSrLWriter.h"
21 #include "OSInstance.h"
22 #include "OSParameters.h"
23 #include "OSnLNode.h"
24 #include "OSiLReader.h"
25 #include "OSoLReader.h"
26 #include "OSInstance.h"
27 #include "OSExpressionTree.h"
28 #include "OSnLNode.h"
29 #include "OSGeneral.h"
30 #include "OSFileUtil.h"
31 #include "OSErrorClass.h"
32 
33 #include "OSResult.h"
34 #include "OSInstance.h"
35 #include "OSOption.h"
36 
37 /*
38  * Include CSDP declarations so that we'll know the calling interfaces.
39  */
40 
41 extern "C"
42 {
43 #include "declarations.h"
44 #include "parameters.h"
45 }
46 
47 
48 #include <cstddef>
49 #include <cstdlib>
50 #include <cctype>
51 #include <cassert>
52 #include <stack>
53 #include <string>
54 #include <iostream>
55 #include <vector>
56 #include <map>
57 
58 
72 class CsdpSolver : public DefaultSolver
73 {
74 // These declarations are taken from the main method csdp.c
75  int nC_rows; // number of rows/columns in each matrix
76  int nC_blks; // number of blocks per matrix
77  int ncon; // number of constraints (and constraint matrices A_i)
78  struct blockmatrix C_matrix; // the matrix in the objective, A0
79  double *rhsValues; // the right-hand side values of the constraints
80  struct constraintmatrix *mconstraints; // the collection of matrices in the constraints (A_i)
81  struct blockmatrix X,Z; // for the primal and dual matrix values, respectively
82  double *y; // dual variables of the constraints
83  double pobj,dobj; // primal and dual objective values
84 
85 public:
86 
88  CsdpSolver();
89 
91  virtual ~CsdpSolver();
92 
95  virtual void solve() throw (ErrorClass) ;
96 
101  virtual void buildSolverInstance() throw(ErrorClass);
102 
107  virtual void setSolverOptions() throw(ErrorClass);
108 
114  //void verifyForm() throw(ErrorClass);
115 
121  void dataEchoCheck();
122 
128 
134 
135 
136 private:
137  OSrLWriter *osrlwriter;
138 
150  // CsdpSolver();
151  //CsdpSolver(const CsdpSolver&);
152  //CsdpSolver& operator=(const CsdpSolver&);
154  //std::string csdpErrorMsg;
155  std::string *csdpErrorMsg;
156 };
157 
158 
159 #endif /*CSDPSOLVER_H*/
The CsdpSolver class solves problems using Csdp.
Definition: OSCsdpSolver.h:72
used for throwing exceptions.
Definition: OSErrorClass.h:31
virtual ~CsdpSolver()
the CsdpSolver class destructor
CsdpSolver()
the CsdpSolver class constructor
Take an OSResult object and write a string that validates against OSrL.
Definition: OSrLWriter.h:30
OSiLReader * m_osilreader
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed ...
Definition: OSCsdpSolver.h:127
virtual void buildSolverInstance()
The implementation of the virtual functions.
Used to read an OSiL string.
Definition: OSiLReader.h:37
Used to read an OSoL string.
Definition: OSoLReader.h:37
OSoLReader * m_osolreader
m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed ...
Definition: OSCsdpSolver.h:133
This file defines the OSInstance class along with its supporting classes.
virtual void setSolverOptions()
The implementation of the virtual functions.
This file defines the OSnLNode class along with its derived classes.
The Default Solver Class.
void dataEchoCheck()
use this for debugging, print out the instance that the solver thinks it has and compare this with th...
virtual void solve()
solve results in an instance being read into the Csdp data structures and optimized ...