#include <BCP_vg.hpp>
Inheritance diagram for BCP_vg_prob:
Public Member Functions | |
BCP_cut * | unpack_cut () |
Unpack a cut. | |
virtual BCP_buffer & | get_message_buffer () |
virtual void | process_message () |
Constructor and destructor | |
BCP_vg_prob (int my_id, int parent) | |
The default constructor. | |
virtual | ~BCP_vg_prob () |
The destructor deletes everything. | |
Query methods | |
bool | has_ub () const |
Return true/false indicating whether any upper bound has been found. | |
double | ub () const |
Return the current upper bound (BCP_DBL_MAX/10 if there's no upper bound found yet. | |
Modifying methods | |
void | ub (const double bd) |
Set the upper bound equal to the argument. | |
bool | probe_messages () |
Test if there is a message in the message queue waiting to be processed. | |
Public Attributes | |
Data members | |
BCP_vg_user * | user |
The user object holding the user's data. | |
BCP_user_pack * | packer |
A class that holds the methods about how to pack things. | |
BCP_message_environment * | msg_env |
The message passing environment. | |
BCP_buffer | msg_buf |
The message buffer of the Variable Generator process. | |
BCP_parameter_set< BCP_vg_par > | par |
The parameters controlling the Variable Generator process. | |
BCP_problem_core * | core |
The description of the core of the problem. | |
double | upper_bound |
The best currently known upper bound. | |
BCP_vec< BCP_cut * > | cuts |
Variables are to be generated for the LP solution given by these cuts and their values (next member). | |
BCP_vec< double > | pi |
The dual values corresponding to the cuts above. | |
int | sender |
The process id of the LP process that sent the solution. | |
int | phase |
The phase the algorithm is in. | |
int | node_level |
The level of search tree node where the solution was generated. | |
int | node_index |
The index of search tree node where the solution was generated. | |
int | node_iteration |
The iteration within the search tree node where the solution was generated. | |
Private Member Functions | |
Disabled members | |
BCP_vg_prob (const BCP_vg_prob &) | |
The copy constructor is declared but not defined to disable it. | |
BCP_vg_prob & | operator= (const BCP_vg_prob &) |
The assignment operator is declared but not defined to disable it. |
Only one object of this type is created and that holds all the data in the VG process. A reference to that object is passed to (almost) every function (or member method) that's invoked within the VG process.
Definition at line 32 of file BCP_vg.hpp.
BCP_vg_prob::BCP_vg_prob | ( | const BCP_vg_prob & | ) | [private] |
The copy constructor is declared but not defined to disable it.
BCP_vg_prob::BCP_vg_prob | ( | int | my_id, | |
int | parent | |||
) |
The default constructor.
Initializes every data member to a natural state.
Definition at line 12 of file BCP_vg.cpp.
BCP_vg_prob::~BCP_vg_prob | ( | ) | [virtual] |
The destructor deletes everything.
Definition at line 18 of file BCP_vg.cpp.
References core, cuts, packer, purge_ptr_vector(), and user.
BCP_vg_prob& BCP_vg_prob::operator= | ( | const BCP_vg_prob & | ) | [private] |
The assignment operator is declared but not defined to disable it.
bool BCP_vg_prob::has_ub | ( | ) | const [inline] |
Return true/false indicating whether any upper bound has been found.
Definition at line 113 of file BCP_vg.hpp.
References BCP_DBL_MAX, and upper_bound.
double BCP_vg_prob::ub | ( | ) | const [inline] |
Return the current upper bound (BCP_DBL_MAX/10
if there's no upper bound found yet.
)
Definition at line 116 of file BCP_vg.hpp.
References upper_bound.
Referenced by unpack_cut(), and BCP_vg_user::upper_bound().
void BCP_vg_prob::ub | ( | const double | bd | ) | [inline] |
Set the upper bound equal to the argument.
Definition at line 122 of file BCP_vg.hpp.
References upper_bound.
bool BCP_vg_prob::probe_messages | ( | ) |
Test if there is a message in the message queue waiting to be processed.
Definition at line 27 of file BCP_vg.cpp.
References BCP_AnyProcess, BCP_Msg_FinishedBCP, BCP_Msg_ForVG_DualFull, BCP_Msg_ForVG_DualNonzeros, BCP_Msg_ForVG_User, BCP_Msg_UpperBound, msg_buf, msg_env, BCP_message_environment::probe(), BCP_message_environment::receive(), BCP_buffer::unpack(), and upper_bound.
Referenced by process_message().
BCP_cut * BCP_vg_prob::unpack_cut | ( | ) |
Unpack a cut.
Invoked from the built-in BCP_vg_user::unpack_dual_solution().
Definition at line 50 of file BCP_vg.cpp.
References BCP_AlgoObj, BCP_CoreObj, BCP_cut::change_bounds(), msg_buf, packer, BCP_cut::set_bcpind(), BCP_cut::set_status(), ub(), BCP_buffer::unpack(), and BCP_user_pack::unpack_cut_algo().
Referenced by BCP_vg_user::unpack_dual_solution().
virtual BCP_buffer& BCP_vg_prob::get_message_buffer | ( | ) | [inline, virtual] |
void BCP_vg_prob::process_message | ( | ) | [virtual] |
Implements BCP_process.
Definition at line 121 of file BCP_vg_main.cpp.
References BCP_Msg_FinishedBCP, BCP_Msg_ForVG_DualFull, BCP_Msg_ForVG_DualNonzeros, BCP_Msg_ForVG_User, BCP_Msg_NextPhaseStarts, BCP_Msg_NoMoreVars, BCP_Msg_UpperBound, BCP_buffer::clear(), cuts, BCP_vg_user::generate_vars(), msg_buf, msg_env, BCP_buffer::msgtag(), node_index, node_iteration, node_level, BCP_buffer::pack(), phase, pi, probe_messages(), BCP_message_environment::send(), BCP_buffer::sender(), sender, timing, BCP_buffer::unpack(), BCP_vg_user::unpack_dual_solution(), upper_bound, and user.
Referenced by BCP_vg_process_message().
The user object holding the user's data.
This object is created by a call to the appropriate member of [USER_initialize
]{USER_initialize.html}.
Definition at line 49 of file BCP_vg.hpp.
Referenced by BCP_vg_main(), process_message(), BCP_single_environment::register_process(), and ~BCP_vg_prob().
A class that holds the methods about how to pack things.
Definition at line 52 of file BCP_vg.hpp.
Referenced by BCP_vg_main(), BCP_single_environment::register_process(), BCP_vg_user::send_var(), unpack_cut(), and ~BCP_vg_prob().
The message passing environment.
This object is created by a call to the appropriate member of [USER_initialize
]{USER_initialize.html}.
Definition at line 57 of file BCP_vg.hpp.
Referenced by BCP_vg_main(), probe_messages(), process_message(), BCP_single_environment::register_process(), and BCP_vg_user::send_var().
The message buffer of the Variable Generator process.
Definition at line 60 of file BCP_vg.hpp.
Referenced by BCP_vg_main(), BCP_vg_process_message(), get_message_buffer(), probe_messages(), process_message(), BCP_vg_user::send_var(), and unpack_cut().
The parameters controlling the Variable Generator process.
Definition at line 63 of file BCP_vg.hpp.
Referenced by BCP_vg_main(), BCP_vg_user::generate_vars(), BCP_vg_user::get_param(), BCP_single_environment::register_process(), BCP_vg_user::set_param(), BCP_vg_user::unpack_dual_solution(), and BCP_vg_user::unpack_module_data().
The description of the core of the problem.
Definition at line 66 of file BCP_vg.hpp.
Referenced by BCP_vg_main(), BCP_single_environment::register_process(), and ~BCP_vg_prob().
double BCP_vg_prob::upper_bound |
The best currently known upper bound.
Definition at line 72 of file BCP_vg.hpp.
Referenced by BCP_vg_main(), has_ub(), probe_messages(), process_message(), and ub().
Variables are to be generated for the LP solution given by these cuts and their values (next member).
Not all cuts need to be listed (e.g., list only those that have nonzero dual values in the current solution).
Definition at line 82 of file BCP_vg.hpp.
Referenced by process_message(), BCP_vg_user::unpack_dual_solution(), and ~BCP_vg_prob().
BCP_vec<double> BCP_vg_prob::pi |
The dual values corresponding to the cuts above.
Definition at line 84 of file BCP_vg.hpp.
Referenced by process_message(), and BCP_vg_user::unpack_dual_solution().
The process id of the LP process that sent the solution.
Definition at line 86 of file BCP_vg.hpp.
Referenced by process_message(), and BCP_vg_user::send_var().
The phase the algorithm is in.
Definition at line 89 of file BCP_vg.hpp.
Referenced by BCP_vg_user::current_phase(), and process_message().
The level of search tree node where the solution was generated.
Definition at line 91 of file BCP_vg.hpp.
Referenced by BCP_vg_user::current_level(), and process_message().
The index of search tree node where the solution was generated.
Definition at line 93 of file BCP_vg.hpp.
Referenced by BCP_vg_user::current_index(), and process_message().
The iteration within the search tree node where the solution was generated.
Definition at line 96 of file BCP_vg.hpp.
Referenced by BCP_vg_user::current_iteration(), and process_message().