BCP_vg_user Class Reference

The BCP_vg_user class is the base class from which the user can derive a problem specific class to be used in the Cut Generator process. More...

#include <BCP_vg_user.hpp>

Inheritance diagram for BCP_vg_user:

Inheritance graph
[legend]
Collaboration diagram for BCP_vg_user:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void send_var (const BCP_var &var)
 Pack the argument into the message buffer and send it to the sender of the LP solution.
virtual void unpack_module_data (BCP_buffer &buf)
 Unpack the initial information sent to the Variable Generator process by the Tree Manager.
virtual void unpack_dual_solution (BCP_buffer &buf)
 Unpack the LP solution arriving from the LP process.
virtual void generate_vars (BCP_vec< BCP_cut * > &cuts, BCP_vec< double > &pi)
 Perform the actual variable generation.
Methods to set and get the pointer to the BCP_vg_prob
object. It is unlikely that the users would want to muck around with these (especially with the set method!) but they are here to provide total control.

void setVgProblemPointer (BCP_vg_prob *ptr)
 Set the pointer.
BCP_vg_probgetVgProblemPointer ()
 Get the pointer.
Informational methods for the user.
double upper_bound () const
 Return what is the best known upper bound (might be BCP_DBL_MAX).
int current_phase () const
 Return the phase the algorithm is in.
int current_level () const
 Return the level of the search tree node for which cuts are being generated.
int current_index () const
 Return the internal index of the search tree node for which cuts are being generated.
int current_iteration () const
 Return the iteration count within the search tree node for which cuts are being generated.
Methods to get/set BCP parameters on the fly
char get_param (const BCP_vg_par::chr_params key) const
int get_param (const BCP_vg_par::int_params key) const
double get_param (const BCP_vg_par::dbl_params key) const
const BCP_stringget_param (const BCP_vg_par::str_params key) const
void set_param (const BCP_vg_par::chr_params key, const bool val)
void set_param (const BCP_vg_par::chr_params key, const char val)
void set_param (const BCP_vg_par::int_params key, const int val)
void set_param (const BCP_vg_par::dbl_params key, const double val)
void set_param (const BCP_vg_par::str_params key, const char *val)
Constructor, Destructor
 BCP_vg_user ()
virtual ~BCP_vg_user ()
 Being virtual, the destructor invokes the destructor for the real type of the object being deleted.

Private Attributes

BCP_vg_probp

Detailed Description

The BCP_vg_user class is the base class from which the user can derive a problem specific class to be used in the Cut Generator process.

In that derived class the user can store data to be used in the methods she overrides. Also that is the object the user must return in the USER_initialize::vg_init() method.

There are two kind of methods in the class. The non-virtual methods are helper functions for the built-in defaults, but the user can use them as well. The virtual methods execute steps in the BCP algorithm where the user might want to override the default behavior.

The default implementations fall into three major categories.

Definition at line 51 of file BCP_vg_user.hpp.


Constructor & Destructor Documentation

BCP_vg_user::BCP_vg_user (  )  [inline]

Definition at line 117 of file BCP_vg_user.hpp.

virtual BCP_vg_user::~BCP_vg_user (  )  [inline, virtual]

Being virtual, the destructor invokes the destructor for the real type of the object being deleted.

Definition at line 120 of file BCP_vg_user.hpp.


Member Function Documentation

void BCP_vg_user::setVgProblemPointer ( BCP_vg_prob ptr  )  [inline]

Set the pointer.

Definition at line 62 of file BCP_vg_user.hpp.

References p.

Referenced by BCP_vg_main(), and BCP_single_environment::register_process().

BCP_vg_prob* BCP_vg_user::getVgProblemPointer (  )  [inline]

Get the pointer.

Definition at line 64 of file BCP_vg_user.hpp.

References p.

double BCP_vg_user::upper_bound (  )  const

Return what is the best known upper bound (might be BCP_DBL_MAX).

Definition at line 15 of file BCP_vg_user.cpp.

References p, and BCP_vg_prob::ub().

int BCP_vg_user::current_phase (  )  const

Return the phase the algorithm is in.

Definition at line 16 of file BCP_vg_user.cpp.

References p, and BCP_vg_prob::phase.

int BCP_vg_user::current_level (  )  const

Return the level of the search tree node for which cuts are being generated.

Definition at line 17 of file BCP_vg_user.cpp.

References BCP_vg_prob::node_level, and p.

int BCP_vg_user::current_index (  )  const

Return the internal index of the search tree node for which cuts are being generated.

Definition at line 18 of file BCP_vg_user.cpp.

References BCP_vg_prob::node_index, and p.

int BCP_vg_user::current_iteration (  )  const

Return the iteration count within the search tree node for which cuts are being generated.

Definition at line 19 of file BCP_vg_user.cpp.

References BCP_vg_prob::node_iteration, and p.

char BCP_vg_user::get_param ( const BCP_vg_par::chr_params  key  )  const

Definition at line 25 of file BCP_vg_user.cpp.

References BCP_parameter_set< Par >::entry(), p, and BCP_vg_prob::par.

int BCP_vg_user::get_param ( const BCP_vg_par::int_params  key  )  const

Definition at line 28 of file BCP_vg_user.cpp.

References BCP_parameter_set< Par >::entry(), p, and BCP_vg_prob::par.

double BCP_vg_user::get_param ( const BCP_vg_par::dbl_params  key  )  const

Definition at line 31 of file BCP_vg_user.cpp.

References BCP_parameter_set< Par >::entry(), p, and BCP_vg_prob::par.

const BCP_string & BCP_vg_user::get_param ( const BCP_vg_par::str_params  key  )  const

Definition at line 34 of file BCP_vg_user.cpp.

References BCP_parameter_set< Par >::entry(), p, and BCP_vg_prob::par.

void BCP_vg_user::set_param ( const BCP_vg_par::chr_params  key,
const bool  val 
)

Definition at line 37 of file BCP_vg_user.cpp.

References p, BCP_vg_prob::par, and BCP_parameter_set< Par >::set_entry().

void BCP_vg_user::set_param ( const BCP_vg_par::chr_params  key,
const char  val 
)

Definition at line 39 of file BCP_vg_user.cpp.

References p, BCP_vg_prob::par, and BCP_parameter_set< Par >::set_entry().

void BCP_vg_user::set_param ( const BCP_vg_par::int_params  key,
const int  val 
)

Definition at line 41 of file BCP_vg_user.cpp.

References p, BCP_vg_prob::par, and BCP_parameter_set< Par >::set_entry().

void BCP_vg_user::set_param ( const BCP_vg_par::dbl_params  key,
const double  val 
)

Definition at line 43 of file BCP_vg_user.cpp.

References p, BCP_vg_prob::par, and BCP_parameter_set< Par >::set_entry().

void BCP_vg_user::set_param ( const BCP_vg_par::str_params  key,
const char *  val 
)

Definition at line 45 of file BCP_vg_user.cpp.

References p, BCP_vg_prob::par, and BCP_parameter_set< Par >::set_entry().

void BCP_vg_user::send_var ( const BCP_var var  ) 

Pack the argument into the message buffer and send it to the sender of the LP solution.

Whenever the user generates a variable in the generate_vars() method she should invoke this method to immediately send off the variable to the LP process.

Definition at line 51 of file BCP_vg_user.cpp.

References BCP_AlgoObj, BCP_Msg_VarDescription, BCP_var::bcpind(), BCP_buffer::clear(), BCP_var::lb(), BCP_vg_prob::msg_buf, BCP_vg_prob::msg_env, BCP_var::obj(), BCP_var::obj_type(), p, BCP_buffer::pack(), BCP_user_pack::pack_var_algo(), BCP_vg_prob::packer, BCP_message_environment::send(), BCP_vg_prob::sender, BCP_var::status(), BCP_var::ub(), and BCP_var::var_type().

void BCP_vg_user::unpack_module_data ( BCP_buffer buf  )  [virtual]

Unpack the initial information sent to the Variable Generator process by the Tree Manager.

This information was packed by the method BCP_tm_user::pack_module_data() invoked with BCP_ProcessType_VG as the third (target process type) argument.
Default: empty method.

Definition at line 72 of file BCP_vg_user.cpp.

References BCP_parameter_set< Par >::entry(), p, BCP_vg_prob::par, and BCP_vg_par::ReportWhenDefaultIsExecuted.

Referenced by BCP_vg_main(), and BCP_single_environment::register_process().

void BCP_vg_user::unpack_dual_solution ( BCP_buffer buf  )  [virtual]

Unpack the LP solution arriving from the LP process.

This method is invoked only if the user packs the info necessary for variable generation by herself, i.e., she overrides the BCP_lp_user::pack_dual_solution() method. If that's the case the user has to unpack the same info she has packed in the LP process.

Definition at line 82 of file BCP_vg_user.cpp.

References BCP_Msg_ForVG_User, BCP_vec< T >::clear(), BCP_vg_prob::cuts, BCP_parameter_set< Par >::entry(), BCP_buffer::msgtag(), p, BCP_vg_prob::par, BCP_vg_prob::pi, purge_ptr_vector(), BCP_vg_par::ReportWhenDefaultIsExecuted, BCP_vec< T >::reserve(), BCP_vec< T >::unchecked_push_back(), BCP_buffer::unpack(), and BCP_vg_prob::unpack_cut().

Referenced by BCP_vg_prob::process_message().

void BCP_vg_user::generate_vars ( BCP_vec< BCP_cut * > &  cuts,
BCP_vec< double > &  pi 
) [virtual]

Perform the actual variable generation.

Whenever a variable is generated, the user should invoke the send_var() method to send the generated variable back to the LP process.

Definition at line 115 of file BCP_vg_user.cpp.

References BCP_parameter_set< Par >::entry(), p, BCP_vg_prob::par, and BCP_vg_par::ReportWhenDefaultIsExecuted.

Referenced by BCP_vg_prob::process_message().


Member Data Documentation

BCP_vg_prob* BCP_vg_user::p [private]

Definition at line 53 of file BCP_vg_user.hpp.

Referenced by current_index(), current_iteration(), current_level(), current_phase(), generate_vars(), get_param(), getVgProblemPointer(), send_var(), set_param(), setVgProblemPointer(), unpack_dual_solution(), unpack_module_data(), and upper_bound().


The documentation for this class was generated from the following files:
Generated on Mon May 3 03:11:48 2010 by  doxygen 1.4.7