00001 /* $Id: OSCsdpSolver.h 4562 2013-01-02 12:31:12Z Gassmann $ */ 00015 #ifndef CSDPSOLVER_H 00016 #define CSDPSOLVER_H 00017 00018 #include "OSConfig.h" 00019 #include "OSDefaultSolver.h" 00020 #include "OSrLWriter.h" 00021 #include "OSInstance.h" 00022 #include "OSParameters.h" 00023 #include "OSnLNode.h" 00024 #include "OSiLReader.h" 00025 #include "OSoLReader.h" 00026 #include "OSInstance.h" 00027 #include "OSExpressionTree.h" 00028 #include "OSnLNode.h" 00029 #include "OSGeneral.h" 00030 #include "OSFileUtil.h" 00031 #include "OSErrorClass.h" 00032 00033 #include "OSResult.h" 00034 #include "OSInstance.h" 00035 #include "OSOption.h" 00036 00037 /* 00038 * Include CSDP declarations so that we'll know the calling interfaces. 00039 */ 00040 00041 extern "C" 00042 { 00043 #include "declarations.h" 00044 #include "parameters.h" 00045 } 00046 00047 00048 #include <cstddef> 00049 #include <cstdlib> 00050 #include <cctype> 00051 #include <cassert> 00052 #include <stack> 00053 #include <string> 00054 #include <iostream> 00055 #include <vector> 00056 #include <map> 00057 00058 00072 class CsdpSolver : public DefaultSolver 00073 { 00074 // These declarations are taken from the main method csdp.c 00075 int nC_rows; // number of rows/columns in each matrix 00076 int nC_blks; // number of blocks per matrix 00077 int ncon; // number of constraints (and constraint matrices A_i) 00078 struct blockmatrix C_matrix; // the matrix in the objective, A0 00079 double *rhsValues; // the right-hand side values of the constraints 00080 struct constraintmatrix *mconstraints; // the collection of matrices in the constraints (A_i) 00081 struct blockmatrix X,Z; // for the primal and dual matrix values, respectively 00082 double *y; // dual variables of the constraints 00083 double pobj,dobj; // primal and dual objective values 00084 00085 public: 00086 00088 CsdpSolver(); 00089 00091 virtual ~CsdpSolver(); 00092 00095 virtual void solve() throw (ErrorClass) ; 00096 00101 virtual void buildSolverInstance() throw(ErrorClass); 00102 00107 virtual void setSolverOptions() throw(ErrorClass); 00108 00114 //void verifyForm() throw(ErrorClass); 00115 00121 void dataEchoCheck(); 00122 00127 OSiLReader *m_osilreader; 00128 00133 OSoLReader *m_osolreader; 00134 00135 00136 private: 00137 OSrLWriter *osrlwriter; 00138 00150 // CsdpSolver(); 00151 //CsdpSolver(const CsdpSolver&); 00152 //CsdpSolver& operator=(const CsdpSolver&); 00154 //std::string csdpErrorMsg; 00155 std::string *csdpErrorMsg; 00156 }; 00157 00158 00159 #endif /*CSDPSOLVER_H*/
1.6.1