00001 /* $Id: CouenneBTPerfIndicator.hpp 1004 2013-10-13 16:04:19Z pbelotti $ 00002 * 00003 * Name: CouenneBTPerfIndicator.hpp 00004 * Author: Pietro Belotti 00005 * Purpose: Measures performance of BT in terms of shrunken bounds 00006 * 00007 * (C) Pietro Belotti, 2011. 00008 * This file is licensed under the Eclipse Public License (EPL) 00009 */ 00010 00011 #ifndef COUENNEBTPERFINDICATOR_HPP 00012 #define COUENNEBTPERFINDICATOR_HPP 00013 00014 #include "CoinHelperFunctions.hpp" 00015 #include <string.h> 00016 00017 #include "CouenneTypes.hpp" 00018 00019 namespace Couenne { 00020 00021 class CouenneProblem; 00022 00023 class CouenneBTPerfIndicator { 00024 00025 protected: 00026 00027 std::string name_; 00028 00029 mutable double nFixed_; 00030 mutable double boundRatio_; 00031 mutable double shrunkInf_; 00032 mutable double shrunkDoubleInf_; 00033 mutable double nProvedInfeas_; 00034 00035 mutable double weightSum_; 00036 00037 mutable double *oldLB_; 00038 mutable double *oldUB_; 00039 00040 mutable double totalTime_; 00041 00042 mutable int nRuns_; 00043 00044 CouenneProblem *problem_; 00045 00046 bool stats_; 00047 00048 public: 00049 00050 00052 CouenneBTPerfIndicator (CouenneProblem *p, const std::string &name); 00053 00055 ~CouenneBTPerfIndicator (); 00056 00058 CouenneBTPerfIndicator (const CouenneBTPerfIndicator &rhs); 00059 00061 CouenneBTPerfIndicator &operator= (const CouenneBTPerfIndicator &rhs); 00062 00064 void setOldBounds (const CouNumber *lb, const CouNumber *ub) const; 00065 00067 void addToTimer (double time) const; 00068 00070 void update (const CouNumber *lb, const CouNumber *ub, int depth) const; 00071 }; 00072 } 00073 00074 #endif