coin-Bcp
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:
49 private:
53  std::string _solvername;
54  double _lower_bound;
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(),
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_lp_result()
The default constructor initializes an empty solution, i.e., one which holds neither an exact nor an ...
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 std::string & solvername() const
const double * lhs() const
const double * x() const
double * _lhs
The left hand sides.
int _termcode
The termination code of the algorithm.
#define BCP_DBL_MAX
Definition: BCP_math.hpp:6
int iternum() const
BCP_lp_result & operator=(const BCP_lp_result &)
The assignment operator is declared but not defined to disable it.
double primalTolerance() const
Return the primal tolerance of the solver.
double _objval
The solution value.
int _iternum
The number of iterations the algorithm took (however the algorithm used interprets &quot;iteration&quot;)...
double objval() const
double * _x
The primal solution.
double * _dj
The reduced costs.
Abstract Base Class for describing an interface to a solver.
double * _pi
The dual solution.
double _primal_tolerance
The zero-tolerance used by the LP solver for the primal solution.
double _lower_bound
The name of the LP solver used.
double _dual_tolerance
The zero-tolerance used by the LP solver for the dual solution.
const double * pi() const
double dualTolerance() const
Return the dual tolerance of the solver.
void get_results(OsiSolverInterface &lp_solver)
Get the result from the LP solver.
int termcode() const
std::string _solvername
The name of the LP solver used.
~BCP_lp_result()
The destructor deletes the data members if they are private copies.
This class holds the results after solving an LP relaxation.
BCP_termcode
LP termination codes.
const double * dj() const