/home/coin/SVN-release/CoinAll-1.1.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_math.hpp"
00011 #include "BCP_error.hpp"
00012 #include "BCP_vector.hpp"
00013 #include "OsiSolverInterface.hpp"
00014 
00016 enum BCP_termcode {
00018   BCP_Abandoned           = 0x01,
00020   BCP_ProvenOptimal       = 0x02,
00022   BCP_ProvenPrimalInf     = 0x04,
00024   BCP_ProvenDualInf       = 0x08,
00026   BCP_PrimalObjLimReached = 0x10,
00028   BCP_DualObjLimReached   = 0x20,
00030   BCP_IterationLimit      = 0x40,
00032   BCP_TimeLimit           = 0x80
00033 };
00034 
00038 class BCP_lp_result {
00039 private:
00043     BCP_lp_result(const BCP_lp_result&);
00045     BCP_lp_result& operator=(const BCP_lp_result&);
00048 private:
00051     double _lower_bound;
00053     double _primal_tolerance;
00055     double _dual_tolerance;
00061     int _termcode;
00064     int     _iternum;
00068     double  _objval;
00070     double* _x;
00072     double* _pi;
00074     double* _dj;
00076     double* _lhs;
00079 public:
00084     BCP_lp_result() :
00085       _lower_bound(-BCP_DBL_MAX), _primal_tolerance(0), _dual_tolerance(0),
00086       _termcode(BCP_ProvenOptimal), _iternum(0), _objval(0),
00087       _x(0), _pi(0), _dj(0), _lhs(0)
00088     {}
00090     ~BCP_lp_result() {
00091       delete[] _x;
00092       delete[] _pi;
00093       delete[] _dj;
00094       delete[] _lhs;
00095     }
00098   //--------------------------------------------------------------------------
00104 
00105     int&          termcode()       { return _termcode; }
00106     int           termcode() const { return _termcode; }
00108     int&          iternum()        { return _iternum; }
00109     int           iternum()  const { return _iternum; }
00111     double&       objval()         { return _objval; }
00112     double        objval()   const { return _objval; }
00114     double* x()                    { return _x; }
00115     const double* x()        const { return _x; }
00117     double* pi()                   { return _pi; }
00118     const double* pi()       const { return _pi; }
00120     double* dj()                   { return _dj; }
00121     const double* dj()       const { return _dj; }
00123     double* lhs()                  { return _lhs; }
00124     const double* lhs()      const { return _lhs; }
00130     double primalTolerance() const { return _primal_tolerance; }
00132     double dualTolerance()   const { return _dual_tolerance; }
00140     void get_results(OsiSolverInterface& lp_solver);
00143     void fake_objective_value(const double val) {
00144       _objval = val;
00145     }
00147 };
00148 
00149 #endif

Generated on Sun Nov 14 14:06:29 2010 for Coin-All by  doxygen 1.4.7