/home/coin/SVN-release/Bcp-1.2.1/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   BCP_tm_prob * p;
00061 public:
00068 
00069     void setTmProblemPointer(BCP_tm_prob * ptr) { p = ptr; }
00071     BCP_tm_prob * getTmProblemPointer() { return p; }
00076 
00077     double upper_bound() const;
00082 
00083     char              get_param(const BCP_tm_par::chr_params key) const;
00085     int               get_param(const BCP_tm_par::int_params key) const;
00087     double            get_param(const BCP_tm_par::dbl_params key) const;
00089     const BCP_string& get_param(const BCP_tm_par::str_params key) const;
00090 
00092     void set_param(const BCP_tm_par::chr_params key, const bool val);
00094     void set_param(const BCP_tm_par::chr_params key, const char val);
00096     void set_param(const BCP_tm_par::int_params key, const int val);
00098     void set_param(const BCP_tm_par::dbl_params key, const double val);
00100     void set_param(const BCP_tm_par::str_params key, const char * val);
00103   //===========================================================================
00106     BCP_tm_user() : p(0) {}
00109     virtual ~BCP_tm_user() {}
00112   //===========================================================================
00113   // Here are the user defined functions. For each of them a default is given
00114   // which can be overridden when the concrete user class is defined.
00115   //===========================================================================
00116 
00126     virtual void
00127     pack_module_data(BCP_buffer& buf, BCP_process_t ptype);
00128 
00136     virtual BCP_solution*
00137     unpack_feasible_solution(BCP_buffer& buf);
00138 
00143     virtual bool
00144     replace_solution(const BCP_solution* old_sol, const BCP_solution* new_sol);
00145 
00148   //--------------------------------------------------------------------------
00150   int process_id() const;
00152   void
00153   send_message(const int target, const BCP_buffer& buf);
00155   void
00156   broadcast_message(const BCP_process_t proc_type, const BCP_buffer& buf);
00159   virtual void
00160   process_message(BCP_buffer& buf);
00161   //--------------------------------------------------------------------------
00173      virtual void
00174      initialize_core(BCP_vec<BCP_var_core*>& vars,
00175                      BCP_vec<BCP_cut_core*>& cuts,
00176                      BCP_lp_relax*& matrix);
00177     //-------------------------------------------------------------------------
00187      virtual void
00188      create_root(BCP_vec<BCP_var*>& added_vars,
00189                  BCP_vec<BCP_cut*>& added_cuts,
00190                  BCP_user_data*& user_data);
00193   //--------------------------------------------------------------------------
00195   virtual void
00196   display_feasible_solution(const BCP_solution* sol);
00197     
00198   //--------------------------------------------------------------------------
00201   virtual void
00202   display_node_information(BCP_tree& search_tree,
00203                            const BCP_tm_node& node);
00204     
00205   //--------------------------------------------------------------------------
00207   virtual void
00208   display_final_information(const BCP_lp_statistics& lp_stat);
00209     
00210   //---------------------------------------------------------------------------
00215     virtual void
00216     init_new_phase(int phase,
00217                    BCP_column_generation& colgen,
00218                    CoinSearchTreeBase*& candidates);
00221   //---------------------------------------------------------------------------
00232     virtual void
00233     change_candidate_heap(CoinSearchTreeManager& candidates,
00234                           const bool new_solution);
00236 };
00237 
00238 //#############################################################################
00239 
00240 #endif

Generated on Thu Jan 15 03:00:59 2009 for coin-Bcp by  doxygen 1.4.7