Bcp  1.4.4
BCP_cg_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_CG_USER_H
4 #define _BCP_CG_USER_H
5 
6 // This file is fully docified.
7 
8 #include "BCP_math.hpp"
9 #include "BCP_vector.hpp"
10 #include "BCP_cg_param.hpp"
11 #include "BCP_string.hpp"
12 #include "BCP_USER.hpp"
13 
14 class BCP_cg_prob;
15 class BCP_buffer;
16 class BCP_var;
17 class BCP_var_algo;
18 class BCP_cut;
19 class BCP_cut_algo;
20 
50 class BCP_cg_user : public BCP_user_class {
51 private:
52  BCP_cg_prob * p;
53 public:
60  void setCgProblemPointer(BCP_cg_prob * ptr) { p = ptr; }
63  BCP_cg_prob * getCgProblemPointer() { return p; }
69  double upper_bound() const;
71  int current_phase() const;
74  int current_level() const;
77  int current_index() const;
80  int current_iteration() const;
85  char get_param(const BCP_cg_par::chr_params key) const;
88  int get_param(const BCP_cg_par::int_params key) const;
90  double get_param(const BCP_cg_par::dbl_params key) const;
92  const BCP_string& get_param(const BCP_cg_par::str_params key) const;
93 
95  void set_param(const BCP_cg_par::chr_params key, const bool val);
97  void set_param(const BCP_cg_par::chr_params key, const char val);
99  void set_param(const BCP_cg_par::int_params key, const int val);
101  void set_param(const BCP_cg_par::dbl_params key, const double val);
103  void set_param(const BCP_cg_par::str_params key, const char * val);
110  void send_cut(const BCP_cut& cut);
111 
112  //===========================================================================
115  BCP_cg_user() : p(0) {}
118  virtual ~BCP_cg_user() {}
121  //===========================================================================
122  // Here are the user defined functions. For each of them a default is given
123  // which can be overridden when the concrete user class is defined.
124  //===========================================================================
130  virtual void
132 
133  //---------------------------------------------------------------------------
139  virtual void
141 
142  //---------------------------------------------------------------------------
146  virtual void
148 };
149 
150 #endif
int_params
Integer parameters.
This is the class from which the user should derive her own algorithmic variables.
Definition: BCP_var.hpp:277
Abstract base class that defines members common to all types of cuts.
Definition: BCP_cut.hpp:29
virtual void unpack_module_data(BCP_buffer &buf)
Unpack the initial information sent to the Cut Generator process by the Tree Manager.
double upper_bound() const
Return what is the best known upper bound (might be BCP_DBL_MAX)
virtual ~BCP_cg_user()
Being virtual, the destructor invokes the destructor for the real type of the object being deleted.
This class is the central class of the Cut Generator process.
Definition: BCP_cg.hpp:32
Abstract base class that defines members common to all types of variables.
Definition: BCP_var.hpp:28
dbl_params
There are no double parameters.
str_params
String parameters.
virtual void generate_cuts(BCP_vec< BCP_var * > &vars, BCP_vec< double > &x)
Perform the actual cut generation.
chr_params
Character parameters.
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
int current_index() const
Return the internal index of the search tree node for which cuts are being generated.
This is the class from which the user should derive her own algorithmic cuts.
Definition: BCP_cut.hpp:242
The BCP_cg_user class is the base class from which the user can derive a problem specific class to be...
Definition: BCP_cg_user.hpp:50
int current_iteration() const
Return the iteration count within the search tree node for which cuts are being generated.
char get_param(const BCP_cg_par::chr_params key) const
void send_cut(const BCP_cut &cut)
Pack the argument into the message buffer and send it to the sender of the LP solution.
int current_phase() const
Return the phase the algorithm is in.
BCP_cg_prob * getCgProblemPointer()
Get the pointer.
Definition: BCP_cg_user.hpp:63
This class is a very simple impelementation of a constant length string.
Definition: BCP_string.hpp:13
virtual void unpack_primal_solution(BCP_buffer &buf)
Unpack the LP solution arriving from the LP process.
void set_param(const BCP_cg_par::chr_params key, const bool val)
void setCgProblemPointer(BCP_cg_prob *ptr)
Set the pointer.
Definition: BCP_cg_user.hpp:61
int current_level() const
Return the level of the search tree node for which cuts are being generated.