/home/coin/SVN-release/Bcp-1.2.1/Applications/Csp/include/CSP_tm.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2005, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef _CSP_TM_H
00004 #define _CSP_TM_H
00005 
00006 #include <OsiClpSolverInterface.hpp>
00007 
00008 #include "BCP_parameters.hpp"
00009 #include "BCP_tm_user.hpp"
00010 
00011 #include "CSP_tm_param.hpp"
00012 #include "CSP_lp_param.hpp"
00013 
00014 #include "CSP.hpp"
00015 #include "CSP_var.hpp"
00016 
00017 //#############################################################################
00018 
00019 class CSP_var;
00020 
00021 //#############################################################################
00022 
00023 class CSP_tm : public BCP_tm_user {
00024 public:
00025    BCP_parameter_set<CSP_tm_par> tm_par;
00026    BCP_parameter_set<CSP_lp_par> lp_par;
00027    CSPROBLEM* csproblem;
00028 
00029 public:
00030   // constructor
00031   CSP_tm() : csproblem(0) {}
00032 
00033   //destructor
00034   ~CSP_tm() { 
00035     delete csproblem; 
00036   }
00037 
00038   //==========================================================================
00039   // Here are the user defined functions. For each of them a default is given
00040   // which can be overridden when the concrete user class is defined.
00041   //==========================================================================
00042   
00049   virtual void
00050   pack_module_data(BCP_buffer& buf, BCP_process_t ptype);
00051   
00059   // *LL* : we use the generic solution, so the default is OK.
00060   // *LL* : otherwise override this AND CSP_lp::pack_feasible_solution()
00061   virtual BCP_solution*
00062   unpack_feasible_solution(BCP_buffer& buf) {
00063     return BCP_tm_user::unpack_feasible_solution(buf);
00064   }
00065   
00067   // *LL* : done
00068   virtual void
00069   pack_var_algo(const BCP_var_algo* var, BCP_buffer& buf) {
00070     CSP_var_pack(var, buf);
00071   }
00073   // *LL* : done
00074   virtual BCP_var_algo*
00075   unpack_var_algo(BCP_buffer& buf) {
00076     return CSP_var_unpack(buf);
00077   }
00078   
00080   // *LL* : needs to be written when we start to add cuts. Not for now.
00081   virtual void
00082   pack_cut_algo(const BCP_cut_algo* cut, BCP_buffer& buf) {
00083     BCP_tm_user::pack_cut_algo(cut, buf);
00084   }
00086   // *LL* : needs to be written when we start to add cuts. Not for now.
00087   virtual BCP_cut_algo*
00088   unpack_cut_algo(BCP_buffer& buf) {
00089     return BCP_tm_user::unpack_cut_algo(buf);
00090   }
00091   
00092   //--------------------------------------------------------------------------
00102   // *LL* : set packing constraints are the core constraint, no core vars, no
00103   // *LL* : core matrix.
00104   virtual void
00105   initialize_core(BCP_vec<BCP_var_core*>& vars,
00106                   BCP_vec<BCP_cut_core*>& cuts,
00107                   BCP_lp_relax*& matrix);
00108   //--------------------------------------------------------------------------
00118   // *LL* : the enumerated vars are the added vars, and since now we
00119   // *LL* : enumerate everything, the pricing status is price nothing.
00120   virtual void
00121   create_root(BCP_vec<BCP_var*>& added_vars,
00122                           BCP_vec<BCP_cut*>& added_cuts,
00123                           BCP_user_data*& user_data,
00124                           BCP_pricing_status& pricing_status);
00125   
00126   //--------------------------------------------------------------------------
00128   virtual void
00129   display_feasible_solution(const BCP_solution* sol);
00130   
00131   //--------------------------------------------------------------------------
00134   // *LL* : default is fine, there's just one phase
00135   virtual void
00136   init_new_phase(int phase, BCP_column_generation& colgen);
00137   
00138   //--------------------------------------------------------------------------
00146   // *LL* : default is fine
00147   virtual bool compare_tree_nodes(const BCP_tm_node* node0,
00148                                   const BCP_tm_node* node1) {
00149     return BCP_tm_user::compare_tree_nodes(node0, node1);
00150   }
00151 };
00152 
00153 #endif

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