BCP_cg_user Class Reference

The BCP_cg_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_cg_user.hpp>

Collaboration diagram for BCP_cg_user:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void send_cut (const BCP_cut &cut)
 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 Cut Generator process by the Tree Manager.
virtual void unpack_primal_solution (BCP_buffer &buf)
 Unpack the LP solution arriving from the LP process.
virtual void generate_cuts (BCP_vec< BCP_var * > &vars, BCP_vec< double > &x)
 Perform the actual cut generation.
virtual void pack_cut_algo (const BCP_cut_algo *cut, BCP_buffer &buf)
 Pack an algorithmic cut into the buffer.
virtual BCP_var_algounpack_var_algo (BCP_buffer &buf)
 Unpack an algorithmic variable from the buffer.
Methods to set and get the pointer to the BCP_cg_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 setCgProblemPointer (BCP_cg_prob *ptr)
 Set the pointer.
BCP_cg_probgetCgProblemPointer ()
 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_cg_par::chr_params key) const
int get_param (const BCP_cg_par::int_params key) const
double get_param (const BCP_cg_par::dbl_params key) const
const BCP_stringget_param (const BCP_cg_par::str_params key) const
void set_param (const BCP_cg_par::chr_params key, const bool val)
void set_param (const BCP_cg_par::chr_params key, const char val)
void set_param (const BCP_cg_par::int_params key, const int val)
void set_param (const BCP_cg_par::dbl_params key, const double val)
void set_param (const BCP_cg_par::str_params key, const char *val)
Constructor, Destructor



 BCP_cg_user ()
 Being virtual, the destructor invokes the destructor for the real type of the object being deleted.
virtual ~BCP_cg_user ()
 Being virtual, the destructor invokes the destructor for the real type of the object being deleted.

Private Attributes

BCP_cg_probp

Detailed Description

The BCP_cg_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::cg_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_cg_user.hpp.


Constructor & Destructor Documentation

BCP_cg_user::BCP_cg_user (  )  [inline]

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

Definition at line 116 of file BCP_cg_user.hpp.

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

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

Definition at line 119 of file BCP_cg_user.hpp.


Member Function Documentation

void BCP_cg_user::setCgProblemPointer ( BCP_cg_prob ptr  )  [inline]

Set the pointer.

Definition at line 62 of file BCP_cg_user.hpp.

BCP_cg_prob* BCP_cg_user::getCgProblemPointer (  )  [inline]

Get the pointer.

Definition at line 64 of file BCP_cg_user.hpp.

double BCP_cg_user::upper_bound (  )  const

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

int BCP_cg_user::current_phase (  )  const

Return the phase the algorithm is in.

int BCP_cg_user::current_level (  )  const

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

int BCP_cg_user::current_index (  )  const

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

int BCP_cg_user::current_iteration (  )  const

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

char BCP_cg_user::get_param ( const BCP_cg_par::chr_params  key  )  const
int BCP_cg_user::get_param ( const BCP_cg_par::int_params  key  )  const
double BCP_cg_user::get_param ( const BCP_cg_par::dbl_params  key  )  const
const BCP_string& BCP_cg_user::get_param ( const BCP_cg_par::str_params  key  )  const
void BCP_cg_user::set_param ( const BCP_cg_par::chr_params  key,
const bool  val 
)
void BCP_cg_user::set_param ( const BCP_cg_par::chr_params  key,
const char  val 
)
void BCP_cg_user::set_param ( const BCP_cg_par::int_params  key,
const int  val 
)
void BCP_cg_user::set_param ( const BCP_cg_par::dbl_params  key,
const double  val 
)
void BCP_cg_user::set_param ( const BCP_cg_par::str_params  key,
const char *  val 
)
void BCP_cg_user::send_cut ( const BCP_cut cut  ) 

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

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

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

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

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

virtual void BCP_cg_user::unpack_primal_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 cut generation by herself, i.e., she overrides the BCP_lp_user::pack_primal_solution(). If that's the case the user has to unpack the same info she has packed in the LP process.

virtual void BCP_cg_user::generate_cuts ( BCP_vec< BCP_var * > &  vars,
BCP_vec< double > &  x 
) [virtual]

Perform the actual cut generation.

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

virtual void BCP_cg_user::pack_cut_algo ( const BCP_cut_algo cut,
BCP_buffer buf 
) [virtual]

Pack an algorithmic cut into the buffer.

When the user generates a cut in generate_cuts() and invokes send_cut() to send it off, this method will be invoked to pack the cut into the buffer if the cut is algorithmic. BCP knows how to pack indexed cuts.

virtual BCP_var_algo* BCP_cg_user::unpack_var_algo ( BCP_buffer buf  )  [virtual]

Unpack an algorithmic variable from the buffer.

This method is invoked when the user does use algorithmic variables and she did not override the unpack_primal_solution() method.


Member Data Documentation

Definition at line 53 of file BCP_cg_user.hpp.


The documentation for this class was generated from the following file:

Generated on 15 Mar 2015 for Coin-All by  doxygen 1.6.1