00001 // Copyright (C) 2000, International Business Machines 00002 // Corporation and others. All Rights Reserved. 00003 #ifndef _BCP_VG_H 00004 #define _BCP_VG_H 00005 00006 // This file is fully docified. 00007 00008 #include <cfloat> 00009 00010 #include "BCP_message_tag.hpp" 00011 #include "BCP_vector.hpp" 00012 #include "BCP_buffer.hpp" 00013 #include "BCP_vg_param.hpp" 00014 #include "BCP_parameters.hpp" 00015 #include "BCP_process.hpp" 00016 00017 class BCP_vg_user; 00018 class BCP_message_environment; 00019 class BCP_proc_id; 00020 class BCP_problem_core; 00021 class BCP_var; 00022 class BCP_cut; 00023 00031 class BCP_vg_prob : public BCP_process { 00032 private: 00036 BCP_vg_prob(const BCP_vg_prob&); 00038 BCP_vg_prob& operator=(const BCP_vg_prob&); 00041 public: 00044 // User provided members-------------------------------------------------- 00048 BCP_vg_user* user; 00052 BCP_message_environment* msg_env; 00053 00055 BCP_buffer msg_buf; 00056 00058 BCP_parameter_set<BCP_vg_par> par; 00059 00061 BCP_problem_core* core; 00062 00064 BCP_proc_id* tree_manager; 00065 00067 double upper_bound; 00068 00069 // the cuts and corresponding dual values in the LP formulation that were 00070 // sent over to generate variables from. Also, the sender and which node 00071 // in which iteration do these cuts/duals belong to. 00077 BCP_vec<BCP_cut*> cuts; 00079 BCP_vec<double> pi; 00081 BCP_proc_id* sender; 00082 00084 int phase; 00086 int node_level; 00088 int node_index; 00091 int node_iteration; 00092 00095 public: 00100 BCP_vg_prob(); 00102 virtual ~BCP_vg_prob(); 00108 inline bool has_ub() const { return upper_bound < DBL_MAX; } 00111 inline double ub() const { return upper_bound; } 00117 inline void ub(const double bd) { upper_bound = bd; } 00118 00121 bool probe_messages(); 00126 BCP_cut* unpack_cut(); 00127 //-------------------------------------------------------------------------- 00128 virtual BCP_buffer& get_message_buffer() { return msg_buf; } 00129 virtual BCP_proc_id* get_parent() { return tree_manager; } 00130 virtual void process_message(); 00131 }; 00132 00133 // This function is used only internally. 00134 bool 00135 BCP_vg_process_message(BCP_vg_prob& p, BCP_buffer& buf); 00136 00137 #endif