- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/OS-2.3.5/ApplicationTemplates/branchCutPrice/include/OS_lp.hpp

Go to the documentation of this file.

    00001 /* $Id: OS_lp.hpp 2904 2009-09-06 06:47:42Z kmartin $ */
    00002 // Last edit: 2/10/05
    00003 //
    00004 // Name:     OS_lp.hpp
    00005 // Author:   Francois Margot
    00006 //           Tepper School of Business
    00007 //           Carnegie Mellon University, Pittsburgh, PA 15213
    00008 //           email: fmargot@andrew.cmu.edu
    00009 // Date:     12/28/03
    00010 //-----------------------------------------------------------------------------
    00011 // Copyright (C) 2003, Francois Margot, International Business Machines
    00012 // Corporation and others.  All Rights Reserved.
    00013
    00014 #ifndef _OS_LP_H
    00015 #define _OS_LP_H
    00016
    00017
    00018 #include "OS.hpp"
    00019 #include "BCP_lp_user.hpp"
    00020 #include "BCP_buffer.hpp"
    00021 #include "BCP_parameters.hpp"
    00022 #include "OS_var.hpp"
    00023 #include "OS_user_data.hpp"
    00024 #include "OS_packer.hpp"
    00025
    00028 class OS_lp : public BCP_lp_user {
    00029
    00030     OsiSolverInterface* cg_lp;
    00031     //BCP_parameter_set<MCF1_par> par;
    00032    // OS_user_data data;
    00033
    00035   OS_prob *os_prob;
    00036
    00038   MY_user_data *p_ud;
    00039
    00041   int in_strong;
    00042
    00044   double EPS;
    00045
    00047   BCP_vec<BCP_cut*> algo_cuts;
    00048
    00050   BCP_vec<BCP_var*> algo_vars;
    00051
    00052
    00053  bool generated_vars;
    00054
    00055
    00056  bool generated_cuts;
    00057
    00059   std::vector<int> violated_cuts;
    00060
    00061 public:
    00062
    00063
    00064
    00065
    00066
    00069
    00070   OS_lp(){}
    00071
    00073   virtual ~OS_lp() {}
    00075
    00078
    00079   virtual void unpack_module_data(BCP_buffer & buf);
    00080
    00082  // virtual void pack_cut_algo(const BCP_cut_algo* cut, BCP_buffer& buf);
    00083
    00085 //  virtual BCP_cut_algo* unpack_cut_algo(BCP_buffer& buf);
    00086
    00087
    00088 //      virtual void pack_var_algo(const BCP_var_algo* var, BCP_buffer& buf) {
    00089
    00090 //              OS_pack_var(var, buf);
    00091 //    }
    00092
    00093  //   virtual BCP_var_algo* unpack_var_algo(BCP_buffer& buf) {
    00094 //                      return OS_unpack_var(buf);
    00095  //   }
    00096
    00098   //virtual void pack_user_data(const BCP_user_data* ud, BCP_buffer& buf);
    00099
    00101   //virtual MY_user_data* unpack_user_data(BCP_buffer& buf);
    00103
    00104   // Tell Bcp which solver to use and set parameters of solver.
    00106   virtual OsiSolverInterface *initialize_solver_interface();
    00107
    00109   virtual void initialize_new_search_tree_node(
    00110                                  const BCP_vec<BCP_var*>& vars,
    00111                                  const BCP_vec<BCP_cut*>& cuts,
    00112                                  const BCP_vec<BCP_obj_status>& var_status,
    00113                                  const BCP_vec<BCP_obj_status>& cut_status,
    00114                                  BCP_vec<int>& var_changed_pos,
    00115                                  BCP_vec<double>& var_new_bd,
    00116                                  BCP_vec<int>& cut_changed_pos,
    00117                                  BCP_vec<double>& cut_new_bd);
    00118
    00122   virtual void modify_lp_parameters(OsiSolverInterface* lp,
    00123                                     bool in_strong_branching);
    00124
    00129  // virtual BCP_solution* test_feasibility(const BCP_lp_result& lp_result,
    00130 //                                       const BCP_vec<BCP_var*>& vars,
    00131 //                                       const BCP_vec<BCP_cut*>& cuts);
    00132
    00133
    00134
    00139
    00140
    00141   //virtual void generate_cuts_in_lp(const BCP_lp_result& lpres,
    00142 //                    const BCP_vec<BCP_var*>& vars,
    00143 //                    const BCP_vec<BCP_cut*>& cuts,
    00144 //                    BCP_vec<BCP_cut*>& new_cuts,
    00145 //                    BCP_vec<BCP_row*>& new_rows);
    00146
    00147
    00148  virtual  void display_lp_solution(const BCP_lp_result& lpres,
    00149                                  const BCP_vec<BCP_var*>& vars,
    00150                                  const BCP_vec<BCP_cut*>& cuts,
    00151                                  const bool final_lp_solution);
    00152
    00154   virtual BCP_solution* generate_heuristic_solution(
    00155                                const BCP_lp_result& lpres,
    00156                                const BCP_vec<BCP_var*>& vars,
    00157                                const BCP_vec<BCP_cut*>& cuts);
    00158
    00162   virtual void
    00163   cuts_to_rows(const BCP_vec<BCP_var*>& vars, // on what to expand
    00164                BCP_vec<BCP_cut*>& cuts,       // what to expand
    00165                BCP_vec<BCP_row*>& rows,       // the expanded rows
    00166                const BCP_lp_result& lpres,
    00167                BCP_object_origin origin, bool allow_multiple);
    00168
    00175
    00176
    00177   virtual BCP_branching_decision
    00178   select_branching_candidates(const BCP_lp_result& lpres,
    00179                               const BCP_vec<BCP_var*>& vars,
    00180                               const BCP_vec<BCP_cut*>& cuts,
    00181                               const BCP_lp_var_pool& local_var_pool,
    00182                               const BCP_lp_cut_pool& local_cut_pool,
    00183                               BCP_vec<BCP_lp_branching_object*>& cands,
    00184                               bool force_branch = false);
    00185
    00188   virtual void set_user_data_for_children(BCP_presolved_lp_brobj* best,
    00189                                           const int selected);
    00190
    00191
    00192
    00193
    00194 //      virtual double  compute_lower_bound(const double old_lower_bound,
    00195 //              const BCP_lp_result& lpres, const BCP_vec<BCP_var*>& vars,
    00196 //              const BCP_vec<BCP_cut*>& cuts);
    00197
    00198
    00199 //      virtual void generate_vars_in_lp(const BCP_lp_result& lpres,
    00200 //              const BCP_vec<BCP_var*>& vars, const BCP_vec<BCP_cut*>& cuts,
    00201 //              const bool before_fathom, BCP_vec<BCP_var*>& new_vars,
    00202 //              BCP_vec<BCP_col*>& new_cols);
    00203
    00204
    00205  virtual void vars_to_cols(const BCP_vec<BCP_cut*>& cuts,
    00206                  BCP_vec<BCP_var*>& vars, BCP_vec<BCP_col*>& cols,
    00207                 const BCP_lp_result& lpres,
    00208                 BCP_object_origin origin, bool allow_multiple);
    00209
    00210
    00211     //===========================================================================
    00238     virtual void process_lp_result(const BCP_lp_result& lpres,
    00239                       const BCP_vec<BCP_var*>& vars,
    00240                       const BCP_vec<BCP_cut*>& cuts,
    00241                       const double old_lower_bound,
    00242                       double& true_lower_bound,
    00243                       BCP_solution*& sol,
    00244                       BCP_vec<BCP_cut*>& new_cuts,
    00245                       BCP_vec<BCP_row*>& new_rows,
    00246                       BCP_vec<BCP_var*>& new_vars,
    00247                       BCP_vec<BCP_col*>& new_cols);
    00248
    00249
    00250
    00251 };
    00252
    00253 #endif