DecompSolverResult.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef DecompSolverResult_h_
00019 #define DecompSolverResult_h_
00020
00021
00027
00028
00029
00030 #include "Decomp.h"
00031 #include "DecompSolution.h"
00032
00033
00034 class DecompSolverResult {
00035
00036
00041
00042 public :
00043 int m_solStatus;
00044 int m_solStatus2;
00045 double m_objLB;
00046 double m_objUB;
00047 bool m_isOptimal;
00048 bool m_isUnbounded;
00049 bool m_isCutoff;
00050 int m_nSolutions;
00051 std::vector< std::vector<double> > m_solution;
00056 public:
00057 const double* getSolution(const int solIndex) {
00058 std::vector<double>& solution = m_solution[solIndex];
00059 return &solution[0];
00060 }
00061
00065 DecompSolverResult():
00066 m_solStatus (-1),
00067 m_solStatus2(-1),
00068 m_objLB (-DecompInf),
00069 m_objUB ( DecompInf),
00070 m_isOptimal (false),
00071 m_isUnbounded (false),
00072 m_isCutoff (false),
00073 m_nSolutions(0) {
00074 }
00075
00076 DecompSolverResult(const DecompSolution* solution):
00077 m_solStatus (-1),
00078 m_solStatus2(-1),
00079 m_objLB (-DecompInf),
00080 m_objUB ( DecompInf),
00081 m_isOptimal (false),
00082 m_isUnbounded (false),
00083 m_isCutoff (false),
00084 m_nSolutions(0) {
00085 const double* values = solution->getValues();
00086
00087 if (!values) {
00088 return;
00089 }
00090
00091 m_nSolutions = 1;
00092 m_objUB = solution->getQuality();
00093 std::vector<double> sol(values, values + solution->getSize());
00094 m_solution.push_back(sol);
00095 }
00096
00100 ~DecompSolverResult() {
00101 }
00105 };
00106
00107 #endif