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,
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_vector.hpp
BCP_lp_result::fake_objective_value
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...
Definition: BCP_lp_result.hpp:148
BCP_lp_result::get_results
void get_results(OsiSolverInterface &lp_solver)
Get the result from the LP solver.
BCP_lp_result::solvername
const std::string & solvername() const
Definition: BCP_lp_result.hpp:108
BCP_DBL_MAX
#define BCP_DBL_MAX
Definition: BCP_math.hpp:6
BCP_Abandoned
@ BCP_Abandoned
Definition: BCP_lp_result.hpp:19
BCP_error.hpp
BCP_ProvenPrimalInf
@ BCP_ProvenPrimalInf
Definition: BCP_lp_result.hpp:23
BCP_lp_result::lhs
const double * lhs() const
Definition: BCP_lp_result.hpp:129
BCP_lp_result
This class holds the results after solving an LP relaxation.
Definition: BCP_lp_result.hpp:39
BCP_ProvenOptimal
@ BCP_ProvenOptimal
Definition: BCP_lp_result.hpp:21
BCP_lp_result::~BCP_lp_result
~BCP_lp_result()
The destructor deletes the data members if they are private copies.
Definition: BCP_lp_result.hpp:94
BCP_math.hpp
BCP_lp_result::objval
double objval() const
Definition: BCP_lp_result.hpp:117
BCP_IterationLimit
@ BCP_IterationLimit
Definition: BCP_lp_result.hpp:31
BCP_lp_result::iternum
int iternum() const
Definition: BCP_lp_result.hpp:114
BCP_lp_result::dualTolerance
double dualTolerance() const
Return the dual tolerance of the solver.
Definition: BCP_lp_result.hpp:137
OsiSolverInterface
BCP_lp_result::pi
const double * pi() const
Definition: BCP_lp_result.hpp:123
BCP_lp_result::dj
const double * dj() const
Definition: BCP_lp_result.hpp:126
BCP_termcode
BCP_termcode
LP termination codes.
Definition: BCP_lp_result.hpp:17
BCP_lp_result::x
const double * x() const
Definition: BCP_lp_result.hpp:120
OsiSolverInterface.hpp
BCP_ProvenDualInf
@ BCP_ProvenDualInf
Definition: BCP_lp_result.hpp:25
BCP_lp_result::primalTolerance
double primalTolerance() const
Return the primal tolerance of the solver.
Definition: BCP_lp_result.hpp:135
BCP_DualObjLimReached
@ BCP_DualObjLimReached
Definition: BCP_lp_result.hpp:29
BCP_TimeLimit
@ BCP_TimeLimit
Definition: BCP_lp_result.hpp:33
BCP_lp_result::termcode
int termcode() const
Definition: BCP_lp_result.hpp:111
BCP_PrimalObjLimReached
@ BCP_PrimalObjLimReached
Definition: BCP_lp_result.hpp:27
BCP_lp_result::BCP_lp_result
BCP_lp_result()
The default constructor initializes an empty solution, i.e., one which holds neither an exact nor an ...
Definition: BCP_lp_result.hpp:87