/home/coin/Bcp-1.0.0/Bcp/src/include/BCP_lp_result.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2000, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef _BCP_LP_RESULT_H
00004 #define _BCP_LP_RESULT_H
00005 
00006 // This file is fully docified.
00007 
00008 #include <cfloat>
00009 
00010 #include "BCP_error.hpp"
00011 #include "BCP_vector.hpp"
00012 #include "OsiSolverInterface.hpp"
00013 
00015 enum BCP_termcode {
00017   BCP_Abandoned           = 0x01,
00019   BCP_ProvenOptimal       = 0x02,
00021   BCP_ProvenPrimalInf     = 0x04,
00023   BCP_ProvenDualInf       = 0x08,
00025   BCP_PrimalObjLimReached = 0x10,
00027   BCP_DualObjLimReached   = 0x20,
00029   BCP_IterationLimit      = 0x40,
00031   BCP_TimeLimit           = 0x80
00032 };
00033 
00037 class BCP_lp_result {
00038 private:
00042     BCP_lp_result(const BCP_lp_result&);
00044     BCP_lp_result& operator=(const BCP_lp_result&);
00047 private:
00050     double _lower_bound;
00052     double _primal_tolerance;
00054     double _dual_tolerance;
00060     int _termcode;
00063     int     _iternum;
00067     double  _objval;
00069     double* _x;
00071     double* _pi;
00073     double* _dj;
00075     double* _lhs;
00078 public:
00083     BCP_lp_result() :
00084       _lower_bound(-DBL_MAX), _primal_tolerance(0), _dual_tolerance(0),
00085       _termcode(BCP_ProvenOptimal), _iternum(0), _objval(0),
00086       _x(0), _pi(0), _dj(0), _lhs(0)
00087     {}
00089     ~BCP_lp_result() {
00090       delete[] _x;
00091       delete[] _pi;
00092       delete[] _dj;
00093       delete[] _lhs;
00094     }
00097   //--------------------------------------------------------------------------
00103 
00104     int&          termcode()       { return _termcode; }
00105     int           termcode() const { return _termcode; }
00107     int&          iternum()        { return _iternum; }
00108     int           iternum()  const { return _iternum; }
00110     double&       objval()         { return _objval; }
00111     double        objval()   const { return _objval; }
00113     double* x()                    { return _x; }
00114     const double* x()        const { return _x; }
00116     double* pi()                   { return _pi; }
00117     const double* pi()       const { return _pi; }
00119     double* dj()                   { return _dj; }
00120     const double* dj()       const { return _dj; }
00122     double* lhs()                  { return _lhs; }
00123     const double* lhs()      const { return _lhs; }
00129     double primalTolerance() const { return _primal_tolerance; }
00131     double dualTolerance()   const { return _dual_tolerance; }
00139     void get_results(OsiSolverInterface& lp_solver);
00142     void fake_objective_value(const double val) {
00143       _objval = val;
00144     }
00146 };
00147 
00148 #endif

Generated on Wed Aug 22 03:00:53 2007 for coin-Bcp by  doxygen 1.4.7