4 #include "CoinTime.hpp"
14 bool cutset_changed,
const bool from_repricing)
16 double time0 = CoinCpuTime();
20 int prev_size = vp.
size();
32 for (i = 0; i < prev_size; ++i) {
40 for (i = 0; i < prev_size; ++i) {
41 vp[i]->set_col(cols[i]);
48 printf(
"LP: Number of leftover vars: %i\n", prev_size);
54 if (new_vars.
size() > 0) {
55 const int new_size = new_vars.
size();
57 for (
int i = 0; i < new_size; ++i) {
65 printf(
"LP: Number of vars generated in the LP process: %i\n",
67 prev_size = vp.
size();
83 p.
lp_solver->getDblParam(OsiDualTolerance, detol);
86 printf(
"LP: Positive rc (hence removed): %i\n", cnt);
87 prev_size = vp.
size();
119 double first_var_time_out = cutset_changed ?
122 double all_vars_time_out = cutset_changed ?
125 double tout = vp.
size() == 0 ? first_var_time_out : all_vars_time_out;
126 double tin = CoinCpuTime();
147 printf(
"LP: Receive vars timed out after %f secs\n",
148 (prev_size != static_cast<int>(vp.
size())?
149 all_vars_time_out : first_var_time_out));
158 tout = vp.
size() == 0 ? first_var_time_out : all_vars_time_out;
162 tout = std::max<double>(0.0, tout - (CoinCpuTime() - tin));
170 printf(
"LP: Number of vars received from VG: %i\n",
171 static_cast<int>(vp.
size() - prev_size));
172 printf(
"LP: Total number of vars in local pool: %i\n",
173 static_cast<int>(vp.
size()));
177 const int oldsize = vp.
size();
179 p.
lp_solver->getDblParam(OsiDualTolerance, detol);
183 LP: *WARNING*: There are vars with positive red cost in the local VP\n\
184 at the end of var generation.\n\
185 Discarding %i variables out of %i.\n", cnt, oldsize);
BCP_message_tag
This enumerative constant describes the message tags different processes of BCP understand.
virtual void send(const int target, const BCP_message_tag tag)=0
Send an empty message (message tag only) to the process given by the frist argument.
Used when receiving, message with any message tag will be received.
Print information if receiving variables is timed out.
BCP_lp_node * node
Description he current search tree node.
Used to indicate that there is no message in the buffer of a process.
virtual void receive(const int source, const BCP_message_tag tag, BCP_buffer &buf, const double timeout)=0
Blocking receive with timeout.
void clear()
Delete every entry.
char param(BCP_lp_par::chr_params key) const
int BCP_lp_next_var_index(BCP_lp_prob &p)
int BCP_lp_generate_vars(BCP_lp_prob &p, bool first_in_loop, const bool from_repricing)
Indicates whether message passing is serial (all processes are on the same processor) or not...
virtual void process_message()
iterator begin()
Return an iterator to the beginning of the object.
void reserve(const size_t n)
Reallocate the object to make space for n entries.
void BCP_price_vars(BCP_lp_prob &p, const bool from_fathom, BCP_vec< BCP_var * > &vars_to_add, BCP_vec< BCP_col * > &cols_to_add)
double time_var_generation
Similar as above for variables.
virtual void vars_to_cols(const BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_var * > &vars, BCP_vec< BCP_col * > &cols, const BCP_lp_result &lpres, BCP_object_origin origin, bool allow_multiple)
Convert a set of variables into corresponding columns for the current LP relaxation.
The Variable Pool is queried for columns that improve the formulation after the first LP realxation i...
int remove_positives(const double etol)
This parameter specifies the time to wait for variables at the first LP relaxation at a search tree n...
BCP_lp_user * user
A class that holds the methods about how to pack things.
The object was left over in the local variable or cut pool of the LP process from the previous iterat...
BCP_message_tag BCP_lp_pack_for_vg(BCP_lp_prob &p)
OsiSolverInterface * lp_solver
A class that holds the methods about how to pack things.
BCP_lp_result * lp_result
BCP_lp_var_pool * local_var_pool
void clear()
Completely clear the buffer.
BCP_message_tag msgtag() const
Return the message tag of the message in the buffer.
This and the following three parameters control how long the LP process waits for generated variables...
Currently there isn't any error handling in BCP.
size_t size() const
Return the current number of entries.
iterator end()
Return an iterator to the end of the object.
void unchecked_push_back(const_reference x)
Append x to the end of the vector.
This parameter specifies the time to wait for variables at iterations that are not the first at a sea...
BCP_message_environment * msg_env
A class that holds the methods about how to pack things.
This class holds the results after solving an LP relaxation.
bool cols_are_valid() const
virtual bool alive(const int pid)=0
Test if the process given by the argument is alive or not.
This parameter specifies the time to wait for the first generated variable at iterations that are not...
void compute_red_costs(const BCP_lp_result &lpres, BCP_lp_var_pool::iterator first, BCP_lp_var_pool::iterator last)