Dip-All  0.91.0
DecompSolverResult.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the DIP Solver Framework. //
3 // //
4 // DIP is distributed under the Eclipse Public License as part of the //
5 // COIN-OR repository (http://www.coin-or.org). //
6 // //
7 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // //
9 // Conceptual Design: Matthew Galati, SAS Institute Inc. //
10 // Ted Ralphs, Lehigh University //
11 // //
12 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, and Ted Ralphs//
13 // All Rights Reserved. //
14 //===========================================================================//
15 
16 
17 //===========================================================================//
18 #ifndef DecompSolverResult_h_
19 #define DecompSolverResult_h_
20 
21 //===========================================================================//
27 //===========================================================================//
28 
29 //===========================================================================//
30 #include "Decomp.h"
31 #include "DecompSolution.h"
32 
33 //===========================================================================//
35 
36  //----------------------------------------------------------------------//
41  //----------------------------------------------------------------------//
42 public :
45  double m_objLB;
46  double m_objUB;
49  bool m_isCutoff;
51  std::vector< std::vector<double> > m_solution;
56 public:
57  const double* getSolution(const int solIndex) {
58  std::vector<double>& solution = m_solution[solIndex];
59  return &solution[0];
60  }
61 
66  m_solStatus (-1),
67  m_solStatus2(-1),
68  m_objLB (-DecompInf),
69  m_objUB ( DecompInf),
70  m_isOptimal (false),
71  m_isUnbounded (false),
72  m_isCutoff (false),
73  m_nSolutions(0) {
74  }
75 
77  m_solStatus (-1),
78  m_solStatus2(-1),
79  m_objLB (-DecompInf),
80  m_objUB ( DecompInf),
81  m_isOptimal (false),
82  m_isUnbounded (false),
83  m_isCutoff (false),
84  m_nSolutions(0) {
85  const double* values = solution->getValues();
86 
87  if (!values) {
88  return;
89  }
90 
91  m_nSolutions = 1;
92  m_objUB = solution->getQuality();
93  std::vector<double> sol(values, values + solution->getSize());
94  m_solution.push_back(sol);
95  }
96 
101  }
105 };
106 
107 #endif
const double * getValues() const
Get solution values.
const int getSize() const
Get length of solution.
std::vector< std::vector< double > > m_solution
~DecompSolverResult()
Destructor.
DecompSolverResult(const DecompSolution *solution)
const double getQuality() const
Get quality of solution.
DecompSolverResult()
Default constructors.
Storage of solver result.
const double * getSolution(const int solIndex)