Bcp  1.4.4
BCP_lp_result.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef _BCP_LP_RESULT_H
4 #define _BCP_LP_RESULT_H
5 
6 // This file is fully docified.
7 
8 #include <cfloat>
9 #include <string>
10 
11 #include "BCP_math.hpp"
12 #include "BCP_error.hpp"
13 #include "BCP_vector.hpp"
14 #include "OsiSolverInterface.hpp"
15 
19  BCP_Abandoned = 0x01,
33  BCP_TimeLimit = 0x80
34 };
35 
40 private:
46  BCP_lp_result& operator=(const BCP_lp_result&);
49 private:
53  std::string _solvername;
54  double _lower_bound;
56  double _primal_tolerance;
58  double _dual_tolerance;
64  int _termcode;
67  int _iternum;
71  double _objval;
73  double* _x;
75  double* _pi;
77  double* _dj;
79  double* _lhs;
82 public:
88  _solvername(),
89  _lower_bound(-BCP_DBL_MAX), _primal_tolerance(0), _dual_tolerance(0),
90  _termcode(BCP_ProvenOptimal), _iternum(0), _objval(0),
91  _x(0), _pi(0), _dj(0), _lhs(0)
92  {}
95  delete[] _x;
96  delete[] _pi;
97  delete[] _dj;
98  delete[] _lhs;
99  }
102  //--------------------------------------------------------------------------
108  const std::string& solvername() const { return _solvername; }
110  // int& termcode() { return _termcode; }
111  int termcode() const { return _termcode; }
113  // int& iternum() { return _iternum; }
114  int iternum() const { return _iternum; }
116  // double& objval() { return _objval; }
117  double objval() const { return _objval; }
119  // double* x() { return _x; }
120  const double* x() const { return _x; }
122  // double* pi() { return _pi; }
123  const double* pi() const { return _pi; }
125  // double* dj() { return _dj; }
126  const double* dj() const { return _dj; }
128  // double* lhs() { return _lhs; }
129  const double* lhs() const { return _lhs; }
135  double primalTolerance() const { return _primal_tolerance; }
137  double dualTolerance() const { return _dual_tolerance; }
145  void get_results(OsiSolverInterface& lp_solver);
148  void fake_objective_value(const double val) {
149  _objval = val;
150  }
152 };
153 
154 #endif
BCP_termcode
LP termination codes.
@ BCP_Abandoned
@ BCP_ProvenOptimal
@ BCP_DualObjLimReached
@ BCP_ProvenPrimalInf
@ BCP_PrimalObjLimReached
@ BCP_ProvenDualInf
@ BCP_TimeLimit
@ BCP_IterationLimit
#define BCP_DBL_MAX
Definition: BCP_math.hpp:6
This class holds the results after solving an LP relaxation.
const std::string & solvername() const
const double * dj() const
const double * x() const
double objval() const
void get_results(OsiSolverInterface &lp_solver)
Get the result from the LP solver.
const double * pi() const
double dualTolerance() const
Return the dual tolerance of the solver.
int termcode() const
~BCP_lp_result()
The destructor deletes the data members if they are private copies.
int iternum() const
void fake_objective_value(const double val)
Set the lower bound and the exact and approximate objective values to the value given in the argument...
const double * lhs() const
BCP_lp_result()
The default constructor initializes an empty solution, i.e., one which holds neither an exact nor an ...
double primalTolerance() const
Return the primal tolerance of the solver.