00001 // Copyright (C) 2000, International Business Machines 00002 // Corporation and others. All Rights Reserved. 00003 #ifndef _BCP_VG_USER_H 00004 #define _BCP_VG_USER_H 00005 00006 // This file is fully docified. 00007 00008 #include "BCP_math.hpp" 00009 #include "BCP_vector.hpp" 00010 #include "BCP_vg_param.hpp" 00011 #include "BCP_string.hpp" 00012 00013 class BCP_vg_prob; 00014 class BCP_buffer; 00015 class BCP_cut; 00016 class BCP_cut_algo; 00017 class BCP_var; 00018 class BCP_var_algo; 00019 00050 class BCP_vg_user { 00051 private: 00052 BCP_vg_prob * p; 00053 public: 00060 00061 void setVgProblemPointer(BCP_vg_prob * ptr) { p = ptr; } 00063 BCP_vg_prob * getVgProblemPointer() { return p; } 00069 double upper_bound() const; 00071 int current_phase() const; 00074 int current_level() const; 00077 int current_index() const; 00080 int current_iteration() const; 00085 00086 char get_param(const BCP_vg_par::chr_params key) const; 00088 int get_param(const BCP_vg_par::int_params key) const; 00090 double get_param(const BCP_vg_par::dbl_params key) const; 00092 const BCP_string& get_param(const BCP_vg_par::str_params key) const; 00093 00095 void set_param(const BCP_vg_par::chr_params key, const bool val); 00097 void set_param(const BCP_vg_par::chr_params key, const char val); 00099 void set_param(const BCP_vg_par::int_params key, const int val); 00101 void set_param(const BCP_vg_par::dbl_params key, const double val); 00103 void set_param(const BCP_vg_par::str_params key, const char * val); 00106 //--------------------------------------------------------------------------- 00111 void send_var(const BCP_var& var); 00112 00113 //=========================================================================== 00116 BCP_vg_user() : p(0) {} 00119 virtual ~BCP_vg_user() {} 00121 //=========================================================================== 00122 // Here are the user defined functions. For each of them a default is given 00123 // which can be overridden when the concrete user class is defined. 00124 //=========================================================================== 00130 virtual void 00131 unpack_module_data(BCP_buffer& buf); 00132 00133 //--------------------------------------------------------------------------- 00140 virtual void 00141 unpack_dual_solution(BCP_buffer& buf); 00142 00143 //--------------------------------------------------------------------------- 00147 virtual void 00148 generate_vars(BCP_vec<BCP_cut*>& cuts, BCP_vec<double>& pi); 00149 00150 //--------------------------------------------------------------------------- 00155 virtual void 00156 pack_var_algo(const BCP_var_algo* var, BCP_buffer& buf); 00157 00158 //--------------------------------------------------------------------------- 00162 virtual BCP_cut_algo* 00163 unpack_cut_algo(BCP_buffer& buf); 00164 }; 00165 00166 //############################################################################# 00167 00168 #endif