00001 // Copyright (C) 2000, International Business Machines 00002 // Corporation and others. All Rights Reserved. 00003 #ifndef _BCP_CG_H 00004 #define _BCP_CG_H 00005 00006 // This file is fully docified. 00007 00008 #include <cfloat> 00009 00010 #include "BCP_math.hpp" 00011 #include "BCP_message_tag.hpp" 00012 #include "BCP_vector.hpp" 00013 #include "BCP_buffer.hpp" 00014 #include "BCP_cg_param.hpp" 00015 #include "BCP_parameters.hpp" 00016 #include "BCP_process.hpp" 00017 00018 class BCP_cg_user; 00019 class BCP_user_pack; 00020 class BCP_message_environment; 00021 class BCP_problem_core; 00022 class BCP_var; 00023 class BCP_cut; 00024 00032 class BCP_cg_prob : public BCP_process { 00033 private: 00037 BCP_cg_prob(const BCP_cg_prob&); 00039 BCP_cg_prob& operator=(const BCP_cg_prob&); 00042 public: 00045 00046 // User provided members --------------------------------------------------- 00050 BCP_cg_user* user; 00051 00053 BCP_user_pack* packer; 00054 00058 BCP_message_environment* msg_env; 00059 00061 BCP_buffer msg_buf; 00062 00064 BCP_parameter_set<BCP_cg_par> par; 00065 00067 BCP_problem_core* core; 00068 00070 // int tree_manager; 00071 00073 double upper_bound; 00074 00075 // the lp solution, its sender and at which node in which iteration the lp 00076 // solution was generated. 00083 BCP_vec<BCP_var*> vars; 00085 BCP_vec<double> x; 00087 int sender; 00088 00089 00091 int phase; 00093 int node_level; 00095 int node_index; 00098 int node_iteration; 00099 00102 public: 00107 BCP_cg_prob(int my_id, int parent); 00109 virtual ~BCP_cg_prob(); 00115 inline bool has_ub() const { return upper_bound < BCP_DBL_MAX / 10; } 00118 inline double ub() const { return upper_bound; } 00124 inline void ub(const double bd) { upper_bound = bd; } 00125 00128 bool probe_messages(); 00133 BCP_var* unpack_var(); 00134 //-------------------------------------------------------------------------- 00135 virtual BCP_buffer& get_message_buffer() { return msg_buf; } 00136 virtual void process_message(); 00137 }; 00138 00139 // This function is used only internally. 00140 bool 00141 BCP_cg_process_message(BCP_cg_prob& p, BCP_buffer& buf); 00142 00143 #endif