Dip 0.95.0
Loading...
Searching...
No Matches
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// Authors: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8// Ted Ralphs, Lehigh University (ted@lehigh.edu) //
9// Jiadong Wang, Lehigh University (jiw408@lehigh.edu) //
10// //
11// Copyright (C) 2002-2019, Lehigh University, Matthew Galati, and Ted Ralphs//
12// All Rights Reserved. //
13//===========================================================================//
14
15
16//===========================================================================//
17#ifndef DecompSolverResult_h_
18#define DecompSolverResult_h_
19
20//===========================================================================//
26//===========================================================================//
27
28//===========================================================================//
29#include "Decomp.h"
30#include "DecompSolution.h"
31
32//===========================================================================//
34
35 //----------------------------------------------------------------------//
40 //----------------------------------------------------------------------//
41public :
44 double m_objLB;
45 double m_objUB;
50 std::vector< std::vector<double> > m_solution;
55public:
56 const double* getSolution(const int solIndex) {
57 std::vector<double>& solution = m_solution[solIndex];
58 return &solution[0];
59 }
60
64 DecompSolverResult(double infinity):
65 m_solStatus (-1),
66 m_solStatus2(-1),
67 m_objLB (-infinity),
68 m_objUB ( infinity),
69 m_isOptimal (false),
70 m_isUnbounded (false),
71 m_isCutoff (false),
72 m_nSolutions(0) {
73 }
74
75 DecompSolverResult(const DecompSolution* solution, double infinity):
76 m_solStatus (-1),
77 m_solStatus2(-1),
78 m_objLB (-infinity),
79 m_objUB ( infinity),
80 m_isOptimal (false),
81 m_isUnbounded (false),
82 m_isCutoff (false),
83 m_nSolutions(0) {
84 const double* values = solution->getValues();
85
86 if (!values) {
87 return;
88 }
89
90 m_nSolutions = 1;
91 m_objUB = solution->getQuality();
92 std::vector<double> sol(values, values + solution->getSize());
93 m_solution.push_back(sol);
94 }
95
100 }
104};
105
106#endif
const int getSize() const
Get length of solution.
const double * getValues() const
Get solution values.
const double getQuality() const
Get quality of solution.
Storage of solver result.
~DecompSolverResult()
Destructor.
std::vector< std::vector< double > > m_solution
const double * getSolution(const int solIndex)
DecompSolverResult(const DecompSolution *solution, double infinity)
DecompSolverResult(double infinity)
Default constructors.