3 #include "CoinTime.hpp"
14 bool varset_changed,
const bool from_repricing)
16 double time0 = CoinCpuTime();
20 int prev_size = cp.
size();
32 for (i = 0; i < prev_size; ++i) {
40 for (i = 0; i < prev_size; ++i) {
41 cp[i]->set_row(rows[i]);
48 printf(
"LP: Number of leftover cuts: %i\n", prev_size);
62 if (new_cuts.
size() > 0) {
63 const int new_size = new_cuts.
size();
64 if (new_rows.
size() != 0) {
65 if (static_cast<int>(new_rows.
size()) != new_size) {
67 LP: uneven new_cuts/new_rows sizes in generate_cuts_in_lp().\n");
77 for (
int i = 0; i < new_size; ++i) {
85 printf(
"LP: Number of cuts generated in the LP process: %i\n",
87 prev_size = cp.
size();
95 p.
lp_solver->getDblParam(OsiPrimalTolerance, petol);
98 printf(
"LP: Non-violated (hence removed): %i\n", cnt);
99 prev_size = cp.
size();
131 double first_cut_time_out = varset_changed ?
134 double all_cuts_time_out = varset_changed ?
137 double tout = cp.
size() == 0 ? first_cut_time_out : all_cuts_time_out;
138 double tin = CoinCpuTime();
148 LP: The TM has died -- LP exiting\n");
151 LP: The CG has died -- LP exiting\n");
154 LP: The CP has died -- LP exiting\n");
157 LP: The VG has died -- LP exiting\n");
160 LP: The VP has died -- LP exiting\n");
164 printf(
"LP: Receive cuts timed out after %f secs\n",
165 (prev_size != static_cast<int>(cp.
size()) ?
166 all_cuts_time_out : first_cut_time_out));
175 tout = cp.
size() == 0 ? first_cut_time_out : all_cuts_time_out;
179 tout = std::max<double>(0.0, tout - (CoinCpuTime() - tin));
187 printf(
"LP: Number of cuts received from CG: %i\n",
188 static_cast<int>(cp.
size() - prev_size));
189 printf(
"LP: Total number of cuts in local pool: %i\n",
190 static_cast<int>(cp.
size()));
194 const int oldsize = cp.
size();
196 p.
lp_solver->getDblParam(OsiPrimalTolerance, petol);
200 LP: *WARNING*: There are nonviolated cuts in the local CP\n\
201 at the end of cut generation.\n\
202 Discarding %i cuts out of %i.\n", cnt, oldsize);
This and the following three parameters control how long the LP process waits for generated cuts...
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.
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 remove_nonviolated(const double etol)
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.
Print the current number of cuts in the cut pool.
BCP_lp_cut_pool * local_cut_pool
int BCP_lp_next_cut_index(BCP_lp_prob &p)
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...
bool rows_are_valid() const
OsiSolverInterface * lp_solver
A class that holds the methods about how to pack things.
BCP_lp_result * lp_result
This parameter specifies the time to wait for cuts at iterations that are not the first at a search t...
void compute_violations(const BCP_lp_result &lpres, BCP_lp_cut_pool::iterator first, BCP_lp_cut_pool::iterator last)
int BCP_lp_generate_cuts(BCP_lp_prob &p, bool first_in_loop, const bool from_repricing)
This parameter specifies the time to wait for cuts at the first LP relaxation at a search tree node...
void clear()
Completely clear the buffer.
BCP_message_tag msgtag() const
Return the message tag of the message in the buffer.
bool user_has_lp_result_processing
Currently there isn't any error handling in BCP.
virtual void cuts_to_rows(const BCP_vec< BCP_var * > &vars, BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_row * > &rows, const BCP_lp_result &lpres, BCP_object_origin origin, bool allow_multiple)
Convert (and possibly lift) a set of cuts into corresponding rows for the current LP relaxation...
The object was generated by a variable or cut generator.
size_t size() const
Return the current number of entries.
virtual void generate_cuts_in_lp(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_cut * > &new_cuts, BCP_vec< BCP_row * > &new_rows)
Generate cuts within the LP process.
iterator end()
Return an iterator to the end of the object.
BCP_message_tag BCP_lp_pack_for_cg(BCP_lp_prob &p)
void unchecked_push_back(const_reference x)
Append x to the end of the vector.
This parameter specifies the time to wait for the first generated cut at iterations that are not the ...
BCP_vec< BCP_cut * > new_cuts
The Cut Pool is queried for violated valid inequalities after the first LP relaxation is solved and t...
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.
BCP_vec< BCP_row * > new_rows
virtual bool alive(const int pid)=0
Test if the process given by the argument is alive or not.
double time_cut_generation
Print information if receiving cuts is timed out.