Dip
0.95.0
src
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
//===========================================================================//
33
class
DecompSolverResult
{
34
35
//----------------------------------------------------------------------//
40
//----------------------------------------------------------------------//
41
public :
42
int
m_solStatus
;
43
int
m_solStatus2
;
44
double
m_objLB
;
45
double
m_objUB
;
46
bool
m_isOptimal
;
47
bool
m_isUnbounded
;
48
bool
m_isCutoff
;
49
int
m_nSolutions
;
50
std::vector< std::vector<double> >
m_solution
;
55
public
:
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
99
~DecompSolverResult
() {
100
}
104
};
105
106
#endif
DecompSolverResult::DecompSolverResult
DecompSolverResult(const DecompSolution *solution, double infinity)
Definition:
DecompSolverResult.h:75
DecompSolverResult::~DecompSolverResult
~DecompSolverResult()
Destructor.
Definition:
DecompSolverResult.h:99
DecompSolverResult::m_solution
std::vector< std::vector< double > > m_solution
Definition:
DecompSolverResult.h:50
DecompSolution::getSize
const int getSize() const
Get length of solution.
Definition:
DecompSolution.h:34
DecompSolverResult::m_objUB
double m_objUB
Definition:
DecompSolverResult.h:45
DecompSolution
Definition:
DecompSolution.h:19
Decomp.h
DecompSolverResult::DecompSolverResult
DecompSolverResult(double infinity)
Default constructors.
Definition:
DecompSolverResult.h:64
DecompSolverResult::getSolution
const double * getSolution(const int solIndex)
Definition:
DecompSolverResult.h:56
DecompSolverResult::m_objLB
double m_objLB
Definition:
DecompSolverResult.h:44
DecompSolution.h
DecompSolution::getValues
const double * getValues() const
Get solution values.
Definition:
DecompSolution.h:39
DecompSolverResult
Storage of solver result.
Definition:
DecompSolverResult.h:33
DecompSolverResult::m_nSolutions
int m_nSolutions
Definition:
DecompSolverResult.h:49
DecompSolution::getQuality
const double getQuality() const
Get quality of solution.
Definition:
DecompSolution.h:44
DecompSolverResult::m_solStatus
int m_solStatus
Definition:
DecompSolverResult.h:42
DecompSolverResult::m_isUnbounded
bool m_isUnbounded
Definition:
DecompSolverResult.h:47
DecompSolverResult::m_solStatus2
int m_solStatus2
Definition:
DecompSolverResult.h:43
DecompSolverResult::m_isCutoff
bool m_isCutoff
Definition:
DecompSolverResult.h:48
DecompSolverResult::m_isOptimal
bool m_isOptimal
Definition:
DecompSolverResult.h:46
Generated by
1.8.17