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_message_environment; 00020 class BCP_proc_id; 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 00055 BCP_message_environment* msg_env; 00056 00058 BCP_buffer msg_buf; 00059 00061 BCP_parameter_set<BCP_cg_par> par; 00062 00064 BCP_problem_core* core; 00065 00067 // BCP_proc_id* tree_manager; 00068 00070 double upper_bound; 00071 00072 // the lp solution, its sender and at which node in which iteration the lp 00073 // solution was generated. 00080 BCP_vec<BCP_var*> vars; 00082 BCP_vec<double> x; 00084 BCP_proc_id* sender; 00085 00086 00088 int phase; 00090 int node_level; 00092 int node_index; 00095 int node_iteration; 00096 00099 public: 00104 BCP_cg_prob(BCP_proc_id* my_id, BCP_proc_id* parent); 00106 virtual ~BCP_cg_prob(); 00112 inline bool has_ub() const { return upper_bound < BCP_DBL_MAX / 10; } 00115 inline double ub() const { return upper_bound; } 00121 inline void ub(const double bd) { upper_bound = bd; } 00122 00125 bool probe_messages(); 00130 BCP_var* unpack_var(); 00131 //-------------------------------------------------------------------------- 00132 virtual BCP_buffer& get_message_buffer() { return msg_buf; } 00133 virtual void process_message(); 00134 }; 00135 00136 // This function is used only internally. 00137 bool 00138 BCP_cg_process_message(BCP_cg_prob& p, BCP_buffer& buf); 00139 00140 #endif