#include <BCP_cg.hpp>
Inheritance diagram for BCP_cg_prob:
Public Member Functions | |
BCP_var * | unpack_var () |
Unpack a variable. | |
virtual BCP_buffer & | get_message_buffer () |
virtual void | process_message () |
Constructor and destructor | |
BCP_cg_prob (int my_id, int parent) | |
The default constructor. | |
virtual | ~BCP_cg_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 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_cg_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 Cut Generator process. | |
BCP_parameter_set< BCP_cg_par > | par |
The parameters controlling the Cut 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_var * > | vars |
Cuts are to be generated for the LP solution given by these variables and their values (next member). | |
BCP_vec< double > | x |
The primal values corresponding to the variables 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_cg_prob (const BCP_cg_prob &) | |
The copy constructor is declared but not defined to disable it. | |
BCP_cg_prob & | operator= (const BCP_cg_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 CG process. A reference to that object is passed to (almost) every function (or member method) that's invoked within the CG process.
Definition at line 32 of file BCP_cg.hpp.
BCP_cg_prob::BCP_cg_prob | ( | const BCP_cg_prob & | ) | [private] |
The copy constructor is declared but not defined to disable it.
BCP_cg_prob::BCP_cg_prob | ( | int | my_id, | |
int | parent | |||
) |
The default constructor.
Initializes every data member to a natural state.
Definition at line 15 of file BCP_cg.cpp.
BCP_cg_prob::~BCP_cg_prob | ( | ) | [virtual] |
The destructor deletes everything.
Definition at line 21 of file BCP_cg.cpp.
References core, packer, purge_ptr_vector(), user, and vars.
BCP_cg_prob& BCP_cg_prob::operator= | ( | const BCP_cg_prob & | ) | [private] |
The assignment operator is declared but not defined to disable it.
bool BCP_cg_prob::has_ub | ( | ) | const [inline] |
Return true/false indicating whether any upper bound has been found.
Definition at line 115 of file BCP_cg.hpp.
References BCP_DBL_MAX, and upper_bound.
double BCP_cg_prob::ub | ( | ) | const [inline] |
Return the current upper bound (BCP_DBL_MAX
if there's no upper bound found yet.
)
Definition at line 118 of file BCP_cg.hpp.
References upper_bound.
Referenced by unpack_var(), and BCP_cg_user::upper_bound().
void BCP_cg_prob::ub | ( | const double | bd | ) | [inline] |
Set the upper bound equal to the argument.
Definition at line 124 of file BCP_cg.hpp.
References upper_bound.
bool BCP_cg_prob::probe_messages | ( | ) |
Test if there is a message in the message queue waiting to be processed.
Definition at line 30 of file BCP_cg.cpp.
References BCP_AnyProcess, BCP_Msg_FinishedBCP, BCP_Msg_ForCG_PrimalFractions, BCP_Msg_ForCG_PrimalFull, BCP_Msg_ForCG_PrimalNonzeros, BCP_Msg_ForCG_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_var * BCP_cg_prob::unpack_var | ( | ) |
Unpack a variable.
Invoked from the built-in BCP_cg_user::unpack_primal_solution().
Definition at line 55 of file BCP_cg.cpp.
References BCP_AlgoObj, BCP_CoreObj, BCP_var::change_bounds(), msg_buf, packer, BCP_var::set_bcpind(), BCP_var::set_obj(), BCP_var::set_status(), BCP_var::set_var_type(), ub(), BCP_buffer::unpack(), and BCP_user_pack::unpack_var_algo().
Referenced by BCP_cg_user::unpack_primal_solution().
virtual BCP_buffer& BCP_cg_prob::get_message_buffer | ( | ) | [inline, virtual] |
void BCP_cg_prob::process_message | ( | ) | [virtual] |
Implements BCP_process.
Definition at line 117 of file BCP_cg_main.cpp.
References BCP_Msg_FinishedBCP, BCP_Msg_ForCG_PrimalFractions, BCP_Msg_ForCG_PrimalFull, BCP_Msg_ForCG_PrimalNonzeros, BCP_Msg_ForCG_User, BCP_Msg_NextPhaseStarts, BCP_Msg_NoMoreCuts, BCP_Msg_UpperBound, BCP_buffer::clear(), BCP_cg_user::generate_cuts(), msg_buf, msg_env, BCP_buffer::msgtag(), node_index, node_iteration, node_level, BCP_buffer::pack(), phase, probe_messages(), BCP_message_environment::send(), BCP_buffer::sender(), sender, timing, BCP_buffer::unpack(), BCP_cg_user::unpack_primal_solution(), upper_bound, user, vars, and x.
Referenced by BCP_cg_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 50 of file BCP_cg.hpp.
Referenced by BCP_cg_main(), process_message(), and ~BCP_cg_prob().
A class that holds the methods about how to pack things.
Definition at line 53 of file BCP_cg.hpp.
Referenced by BCP_cg_main(), BCP_cg_user::send_cut(), unpack_var(), and ~BCP_cg_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 58 of file BCP_cg.hpp.
Referenced by BCP_cg_main(), probe_messages(), process_message(), and BCP_cg_user::send_cut().
The message buffer of the Cut Generator process.
Definition at line 61 of file BCP_cg.hpp.
Referenced by BCP_cg_main(), BCP_cg_process_message(), get_message_buffer(), probe_messages(), process_message(), BCP_cg_user::send_cut(), and unpack_var().
The parameters controlling the Cut Generator process.
Definition at line 64 of file BCP_cg.hpp.
Referenced by BCP_cg_main(), BCP_cg_user::generate_cuts(), BCP_cg_user::get_param(), BCP_cg_user::set_param(), BCP_cg_user::unpack_module_data(), and BCP_cg_user::unpack_primal_solution().
The description of the core of the problem.
Definition at line 67 of file BCP_cg.hpp.
Referenced by BCP_cg_main(), and ~BCP_cg_prob().
double BCP_cg_prob::upper_bound |
The best currently known upper bound.
Definition at line 73 of file BCP_cg.hpp.
Referenced by BCP_cg_main(), has_ub(), probe_messages(), process_message(), and ub().
Cuts are to be generated for the LP solution given by these variables and their values (next member).
Not all variables need to be listed (e.g., list only those that have fractional values in current LP solution).
Definition at line 83 of file BCP_cg.hpp.
Referenced by process_message(), BCP_cg_user::unpack_primal_solution(), and ~BCP_cg_prob().
BCP_vec<double> BCP_cg_prob::x |
The primal values corresponding to the variables above.
Definition at line 85 of file BCP_cg.hpp.
Referenced by process_message(), and BCP_cg_user::unpack_primal_solution().
The process id of the LP process that sent the solution.
Definition at line 87 of file BCP_cg.hpp.
Referenced by process_message(), and BCP_cg_user::send_cut().
The phase the algorithm is in.
Definition at line 91 of file BCP_cg.hpp.
Referenced by BCP_cg_user::current_phase(), and process_message().
The level of search tree node where the solution was generated.
Definition at line 93 of file BCP_cg.hpp.
Referenced by BCP_cg_user::current_level(), and process_message().
The index of search tree node where the solution was generated.
Definition at line 95 of file BCP_cg.hpp.
Referenced by BCP_cg_user::current_index(), and process_message().
The iteration within the search tree node where the solution was generated.
Definition at line 98 of file BCP_cg.hpp.
Referenced by BCP_cg_user::current_iteration(), and process_message().