Bcp  1.4.4
BCP_vg_user.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef _BCP_VG_USER_H
4 #define _BCP_VG_USER_H
5 
6 // This file is fully docified.
7 
8 #include "BCP_math.hpp"
9 #include "BCP_vector.hpp"
10 #include "BCP_vg_param.hpp"
11 #include "BCP_string.hpp"
12 #include "BCP_USER.hpp"
13 
14 class BCP_vg_prob;
15 class BCP_buffer;
16 class BCP_cut;
17 class BCP_cut_algo;
18 class BCP_var;
19 class BCP_var_algo;
20 
51 class BCP_vg_user : public BCP_user_class {
52 private:
53  BCP_vg_prob * p;
54 public:
61  void setVgProblemPointer(BCP_vg_prob * ptr) { p = ptr; }
64  BCP_vg_prob * getVgProblemPointer() { return p; }
70  double upper_bound() const;
72  int current_phase() const;
75  int current_level() const;
78  int current_index() const;
81  int current_iteration() const;
86  char get_param(const BCP_vg_par::chr_params key) const;
89  int get_param(const BCP_vg_par::int_params key) const;
91  double get_param(const BCP_vg_par::dbl_params key) const;
93  const BCP_string& get_param(const BCP_vg_par::str_params key) const;
94 
96  void set_param(const BCP_vg_par::chr_params key, const bool val);
98  void set_param(const BCP_vg_par::chr_params key, const char val);
100  void set_param(const BCP_vg_par::int_params key, const int val);
102  void set_param(const BCP_vg_par::dbl_params key, const double val);
104  void set_param(const BCP_vg_par::str_params key, const char * val);
107  //---------------------------------------------------------------------------
112  void send_var(const BCP_var& var);
113 
114  //===========================================================================
117  BCP_vg_user() : p(0) {}
120  virtual ~BCP_vg_user() {}
122  //===========================================================================
123  // Here are the user defined functions. For each of them a default is given
124  // which can be overridden when the concrete user class is defined.
125  //===========================================================================
131  virtual void
133 
134  //---------------------------------------------------------------------------
141  virtual void
143 
144  //---------------------------------------------------------------------------
148  virtual void
150 };
151 
152 //#############################################################################
153 
154 #endif
BCP_vg_user::set_param
void set_param(const BCP_vg_par::int_params key, const int val)
BCP_vector.hpp
BCP_vg_user::unpack_module_data
virtual void unpack_module_data(BCP_buffer &buf)
Unpack the initial information sent to the Variable Generator process by the Tree Manager.
BCP_vg_par::int_params
int_params
Definition: BCP_vg_param.hpp:18
BCP_vg_user::getVgProblemPointer
BCP_vg_prob * getVgProblemPointer()
Get the pointer.
Definition: BCP_vg_user.hpp:64
BCP_vg_user::get_param
int get_param(const BCP_vg_par::int_params key) const
BCP_vg_user::generate_vars
virtual void generate_vars(BCP_vec< BCP_cut * > &cuts, BCP_vec< double > &pi)
Perform the actual variable generation.
BCP_vg_par::chr_params
chr_params
Definition: BCP_vg_param.hpp:7
BCP_vg_user::get_param
double get_param(const BCP_vg_par::dbl_params key) const
BCP_vg_user
The BCP_vg_user class is the base class from which the user can derive a problem specific class to be...
Definition: BCP_vg_user.hpp:51
BCP_vg_user::upper_bound
double upper_bound() const
Return what is the best known upper bound (might be BCP_DBL_MAX)
BCP_vec< BCP_cut * >
BCP_vg_user::set_param
void set_param(const BCP_vg_par::chr_params key, const char val)
BCP_vg_user::send_var
void send_var(const BCP_var &var)
Pack the argument into the message buffer and send it to the sender of the LP solution.
BCP_vg_user::get_param
const BCP_string & get_param(const BCP_vg_par::str_params key) const
BCP_vg_user::unpack_dual_solution
virtual void unpack_dual_solution(BCP_buffer &buf)
Unpack the LP solution arriving from the LP process.
BCP_math.hpp
BCP_vg_par::dbl_params
dbl_params
Definition: BCP_vg_param.hpp:38
BCP_string
This class is a very simple impelementation of a constant length string.
Definition: BCP_string.hpp:13
BCP_string.hpp
BCP_user_class
Definition: BCP_USER.hpp:26
BCP_var_algo
This is the class from which the user should derive her own algorithmic variables.
Definition: BCP_var.hpp:277
BCP_vg_par::str_params
str_params
Definition: BCP_vg_param.hpp:43
BCP_cut
Abstract base class that defines members common to all types of cuts.
Definition: BCP_cut.hpp:29
BCP_vg_user::~BCP_vg_user
virtual ~BCP_vg_user()
Being virtual, the destructor invokes the destructor for the real type of the object being deleted.
Definition: BCP_vg_user.hpp:120
BCP_vg_user::current_phase
int current_phase() const
Return the phase the algorithm is in.
BCP_vg_user::setVgProblemPointer
void setVgProblemPointer(BCP_vg_prob *ptr)
Set the pointer.
Definition: BCP_vg_user.hpp:62
BCP_vg_user::set_param
void set_param(const BCP_vg_par::str_params key, const char *val)
BCP_vg_prob
This class is the central class of the Variable Generator process.
Definition: BCP_vg.hpp:32
BCP_vg_user::current_iteration
int current_iteration() const
Return the iteration count within the search tree node for which cuts are being generated.
BCP_vg_user::current_index
int current_index() const
Return the internal index of the search tree node for which cuts are being generated.
BCP_var
Abstract base class that defines members common to all types of variables.
Definition: BCP_var.hpp:28
BCP_vg_user::BCP_vg_user
BCP_vg_user()
Definition: BCP_vg_user.hpp:117
BCP_vg_user::set_param
void set_param(const BCP_vg_par::dbl_params key, const double val)
BCP_USER.hpp
BCP_vg_user::current_level
int current_level() const
Return the level of the search tree node for which cuts are being generated.
BCP_vg_user::set_param
void set_param(const BCP_vg_par::chr_params key, const bool val)
BCP_buffer
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
BCP_vg_user::get_param
char get_param(const BCP_vg_par::chr_params key) const
BCP_vg_param.hpp
BCP_cut_algo
This is the class from which the user should derive her own algorithmic cuts.
Definition: BCP_cut.hpp:242