/home/coin/SVN-release/Bcp-1.3.0/Bcp/src/include/BCP_tm_user.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2000, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef _BCP_TM_USER_FUN_H
00004 #define _BCP_TM_USER_FUN_H
00005 
00006 // This file is fully docified.
00007 
00008 #include "BCP_math.hpp"
00009 #include "BCP_enum.hpp"
00010 #include "BCP_enum_process_t.hpp"
00011 #include "BCP_vector.hpp"
00012 #include "BCP_string.hpp"
00013 #include "BCP_buffer.hpp"
00014 #include "BCP_solution.hpp"
00015 #include "BCP_warmstart.hpp"
00016 #include "BCP_var.hpp"
00017 #include "BCP_cut.hpp"
00018 #include "BCP_matrix.hpp"
00019 #include "BCP_tm_param.hpp"
00020 #include "BCP_tm_node.hpp"
00021 #include "BCP_enum_tm.hpp"
00022 #include "BCP_enum_process_t.hpp"
00023 #include "BCP_USER.hpp"
00024 
00025 class BCP_lp_statistics;
00026 
00027 //#############################################################################
00028 
00058 class BCP_tm_user : public BCP_user_class {
00059 private:
00060   mutable BCP_tm_prob * p;
00061 public:
00068 
00069   void setTmProblemPointer(BCP_tm_prob * ptr) { p = ptr; }
00071   BCP_tm_prob * getTmProblemPointer() const { return p; }
00076 
00077   double upper_bound() const;
00081   double lower_bound() const;
00086 
00087   char              get_param(const BCP_tm_par::chr_params key) const;
00089   int               get_param(const BCP_tm_par::int_params key) const;
00091   double            get_param(const BCP_tm_par::dbl_params key) const;
00093   const BCP_string& get_param(const BCP_tm_par::str_params key) const;
00094 
00096   void set_param(const BCP_tm_par::chr_params key, const bool val);
00098   void set_param(const BCP_tm_par::chr_params key, const char val);
00100   void set_param(const BCP_tm_par::int_params key, const int val);
00102   void set_param(const BCP_tm_par::dbl_params key, const double val);
00104   void set_param(const BCP_tm_par::str_params key, const char * val);
00107   //===========================================================================
00110   BCP_tm_user() : p(0) {}
00113   virtual ~BCP_tm_user() {}
00116   //===========================================================================
00117   // Here are the user defined functions. For each of them a default is given
00118   // which can be overridden when the concrete user class is defined.
00119   //===========================================================================
00120 
00130   virtual void
00131   pack_module_data(BCP_buffer& buf, BCP_process_t ptype);
00132 
00140   virtual BCP_solution*
00141   unpack_feasible_solution(BCP_buffer& buf);
00142 
00147   virtual bool
00148   replace_solution(const BCP_solution* old_sol, const BCP_solution* new_sol);
00149 
00152   //--------------------------------------------------------------------------
00154   int process_id() const;
00156   void
00157   send_message(const int target, const BCP_buffer& buf);
00159   void
00160   broadcast_message(const BCP_process_t proc_type, const BCP_buffer& buf);
00163   virtual void
00164   process_message(BCP_buffer& buf);
00165   //--------------------------------------------------------------------------
00177   virtual void
00178   initialize_core(BCP_vec<BCP_var_core*>& vars,
00179                   BCP_vec<BCP_cut_core*>& cuts,
00180                   BCP_lp_relax*& matrix);
00181   //-------------------------------------------------------------------------
00191   virtual void
00192   create_root(BCP_vec<BCP_var*>& added_vars,
00193               BCP_vec<BCP_cut*>& added_cuts,
00194               BCP_user_data*& user_data);
00197   //--------------------------------------------------------------------------
00199   virtual void
00200   display_feasible_solution(const BCP_solution* sol);
00201     
00202   //--------------------------------------------------------------------------
00207   virtual void
00208   display_node_information(BCP_tree& search_tree,
00209                            const BCP_tm_node& node);
00210     
00211   //--------------------------------------------------------------------------
00215   virtual void
00216   display_node_information(BCP_tree& search_tree,
00217                            const BCP_tm_node& node,
00218                            bool after_processing_node);
00219     
00220   //--------------------------------------------------------------------------
00222   virtual void
00223   display_final_information(const BCP_lp_statistics& lp_stat);
00224     
00225   //---------------------------------------------------------------------------
00230   virtual void
00231   init_new_phase(int phase,
00232                  BCP_column_generation& colgen,
00233                  CoinSearchTreeBase*& candidates);
00236   //---------------------------------------------------------------------------
00247   virtual void
00248   change_candidate_heap(CoinSearchTreeManager& candidates,
00249                         const bool new_solution);
00251 };
00252 
00253 //#############################################################################
00254 
00255 #endif

Generated on Thu Jul 21 03:01:39 2011 for coin-Bcp by  doxygen 1.4.7