9 #include "CoinTime.hpp"
37 const int bvarnum = bvars.
size();
41 for (
int i = 0; i < bvarnum; ++i) {
47 const int bcutnum = bcuts.
size();
51 for (
int i = 0; i < bcutnum; ++i) {
61 int my_id,
int parent,
double ub)
75 CoinWallclockTime(wallclockInit);
85 char *logname =
new char[len + 300];
86 memcpy(logname, log.
c_str(), len);
87 memcpy(logname + len,
"-lp-", 4);
90 len = strlen(logname);
92 sprintf(logname + len,
"%i", static_cast<int>(
GETPID));
93 logfile = freopen(logname,
"a", stdout);
95 fprintf(stderr,
"Error while redirecting stdout: %i\n", errno);
98 setvbuf(logfile, NULL, _IOLBF, 0);
101 setvbuf(stdout, NULL, _IOLBF, 0);
BCP_message_tag
This enumerative constant describes the message tags different processes of BCP understand.
BCP_parameter_set< BCP_lp_par > par
Used when receiving, message with any message tag will be received.
BCP_lp_node * node
Description he current search tree node.
BCP_buffer & unpack(T &value)
Unpack a single object of type T.
virtual OsiSolverInterface * initialize_solver_interface()
Create LP solver environment.
virtual void receive(const int source, const BCP_message_tag tag, BCP_buffer &buf, const double timeout)=0
Blocking receive with timeout.
This is an abstract base class that describes the message passing environment.
BCP_process_t
This enumerative constant describes the various process types.
char entry(const chr_params key) const
const char * c_str() const
virtual BCP_user_pack * packer_init(BCP_user_class *p)
OsiSolverInterface * master_lp
A class that holds the methods about how to pack things.
void BCP_lp_process_core(BCP_lp_prob &p, BCP_buffer &buf)
The TM sends the description of the core formulation to the slave process.
virtual void process_message()
Core cuts are the cuts that always stay in the LP formulation.
The TM sends the process type to the process (LP, Cut Generator, etc.)
virtual void initialize_int_and_sos_list(std::vector< OsiObject * > &intAndSosObjects)
Create the list of objects that can be used for branching (simple integer vars and SOS sets)...
void unpack(BCP_buffer &buf)
Unpack the contents of the core description from the buffer.
void reserve(const size_t n)
Reallocate the object to make space for n entries.
#define setpriority(x, y, z)
This class is a very simple impelementation of a constant length string.
Core variables are the variables that always stay in the LP formulation.
BCP_vec< BCP_cut_core * > cuts
A vector of pointers to the cuts in the core of the problem.
BCP_process_t BCP_lp_main(BCP_message_environment *msg_env, USER_initialize *user_init, int my_id, int parent, double ub)
BCP_lp_user * user
A class that holds the methods about how to pack things.
This class is an abstract base class for the initializer class the user has to provide.
BCP_user_class * user_class
A pointer ot the usr class of the process from which the methods of this class are invoked from...
#define gethostname(x, y)
The TM sends the appropriate parameters to the slave process.
virtual void unpack_module_data(BCP_buffer &buf)
Unpack the initial information sent to the LP process by the Tree Manager.
void setLpProblemPointer(BCP_lp_prob *ptr)
Set the pointer.
The TM sends the initial user packed information to the slave process.
void clear()
Completely clear the buffer.
BCP_message_tag msgtag() const
Return the message tag of the message in the buffer.
The filename all the output should go to.
Currently there isn't any error handling in BCP.
What should be the "niceness" of the LP process.
size_t size() const
Return the current number of entries.
std::vector< OsiObject * > intAndSosObjects
Things that can be branched on.
This class describes the message buffer used for all processes of BCP.
virtual BCP_lp_user * lp_init(BCP_lp_prob &p)
void unchecked_push_back(const_reference x)
Append x to the end of the vector.
void unpack(BCP_buffer &buf)
Unpack the parameter set from the buffer.
BCP_message_environment * msg_env
A class that holds the methods about how to pack things.
BCP_problem_core_change * core_as_change
BCP_vec< BCP_var_core * > vars
A vector of pointers to the variables in the core of the problem.
CouExpr & log(CouExpr &e)
BCP_user_pack * packer
A class that holds the methods about how to pack things.