120 const int varnum = vars.
size();
123 for (i = 0; i < varnum; ++i) {
127 const int cutnum = cuts.
size();
130 for (i = 0; i < cutnum; ++i) {
150 const int var_change_num = vcp.
size();
151 if (var_change_num > 0) {
155 for (i = 0; i < var_change_num; ++i) {
156 const double new_lb = *newbd;
158 const double new_ub = *newbd;
160 const int pos = vcp[i];
161 if (vars[pos]->lb() > new_lb+petol || vars[pos]->ub() < new_ub-petol)
168 const int cut_change_num = ccp.
size();
169 if (cut_change_num > 0) {
173 for (i = 0; i < cut_change_num; ++i) {
174 const double new_lb = *newbd;
176 const double new_ub = *newbd;
178 const int pos = ccp[i];
179 if (cuts[pos]->lb() > new_lb+petol || cuts[pos]->ub() < new_ub-petol)
186 if (lp.numberObjects() == 0) {
189 const int numObj = lp.numberObjects();
190 OsiObject** obj = lp.objects();
191 for (
int i = 0; i < numObj; ++i) {
192 OsiSimpleInteger* io =
dynamic_cast<OsiSimpleInteger*
>(obj[i]);
194 io->resetBounds(&lp);
201 for (
int i = 0; i < varnum; ++i) {
206 lp.findIntegersAndSOS(
false);
222 const int colnum = cols.
size();
223 double * clb =
new double[colnum];
224 double * cub =
new double[colnum];
225 double * obj =
new double[colnum];
226 const CoinPackedVectorBase** vectors =
227 new const CoinPackedVectorBase*[colnum];
228 for (
int i = 0; i < colnum; ++i) {
235 lp->addCols(colnum, vectors, clb, cub, obj);
247 const int rownum = rows.
size();
248 double * rlb =
new double[rownum];
249 double * rub =
new double[rownum];
250 const CoinPackedVectorBase** vectors =
251 new const CoinPackedVectorBase*[rownum];
252 for (
int i = 0; i < rownum; ++i) {
258 lp->addRows(rownum, vectors, rlb, rub);
double LowerBound() const
Return the lower bound.
void BCP_lp_add_rows_to_lp(const BCP_vec< BCP_row * > &rows, OsiSolverInterface *lp)
BCP_message_tag
This enumerative constant describes the message tags different processes of BCP understand.
This class holds a column in a compressed form.
BCP_buffer & pack(const T &value)
Pack a single object of type T.
double LowerBound() const
Return the lower bound.
double UpperBound() const
Return the upper bound.
BCP_lp_node * node
Description he current search tree node.
virtual void process_lp_result(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const double old_lower_bound, double &true_lower_bound, BCP_solution *&sol, BCP_vec< BCP_cut * > &new_cuts, BCP_vec< BCP_row * > &new_rows, BCP_vec< BCP_var * > &new_vars, BCP_vec< BCP_col * > &new_cols)
Process the result of an iteration.
BCP_lp_parent * parent
Description of the parent of the current node.
pos
position where the operator should be printed when printing the expression
char param(BCP_lp_par::chr_params key) const
void BCP_lp_process_result(BCP_lp_prob &p, const BCP_lp_result &lpres)
void BCP_lp_add_cols_to_lp(const BCP_vec< BCP_col * > &cols, OsiSolverInterface *lp)
void BCP_lp_test_feasibility(BCP_lp_prob &p, const BCP_lp_result &lpres)
virtual double compute_lower_bound(const double old_lower_bound, const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts)
Compute a true lower bound for the subproblem.
iterator begin()
Return an iterator to the beginning of the object.
This class is just a collection of pointers to cuts with a number of methods to manipulate these cuts...
void reserve(const size_t n)
Reallocate the object to make space for n entries.
virtual void pack_primal_solution(BCP_buffer &buf, const BCP_lp_result &lp_result, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts)
Pack the information necessary for cut generation into the buffer.
double BCP_lp_compute_lower_bound(BCP_lp_prob &p, const BCP_lp_result &lpres)
The user packed everything.
virtual void purge_slack_pool(const BCP_vec< BCP_cut * > &slack_pool, BCP_vec< int > &to_be_purged)
Selectively purge the list of slack cuts.
BCP_vec< BCP_var * > new_vars
size_t varnum() const
Return the number of variables in the core.
Specifies how warmstart information should be stored in the TM.
BCP_lp_cut_pool * local_cut_pool
The user packed everything.
double primalTolerance() const
Return the primal tolerance of the solver.
BCP_lp_user * user
A class that holds the methods about how to pack things.
void fint fint fint real fint real real real real real real real real real fint real fint * lp
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
CoinWarmStart * warmstartRoot
Description of the warmstart info from the end of the root node.
void set_msgtag(const BCP_message_tag tag)
Set the message tag on the buffer.
size_t cutnum() const
Return the number of cuts in the core.
double Objective() const
Return the objective coefficient.
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.
Use the warmstart info from the end of the root in all search tree nodes.
void set_lb_ub(const BCP_vec< int > &pos, BCP_vec< double >::const_iterator bounds)
Set the lower/upper bound pairs of the entries given by the contents of pos to the values in [bounds...
void BCP_lp_purge_slack_pool(BCP_lp_prob &p)
bool user_has_lp_result_processing
virtual BCP_solution * test_feasibility(const BCP_lp_result &lp_result, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts)
Evaluate and return MIP feasibility of the current solution.
Currently there isn't any error handling in BCP.
double UpperBound() const
Return the upper bound.
void BCP_lp_prepare_for_new_node(BCP_lp_prob &p)
void BCP_lp_clean_up_node(BCP_lp_prob &p)
size_t size() const
Return the current number of entries.
BCP_vec< BCP_cut * > slack_pool
iterator end()
Return an iterator to the end of the object.
This class is just a collection of pointers to variables with a number of methods to manipulate these...
std::vector< OsiObject * > intAndSosObjects
Things that can be branched on.
This class describes the message buffer used for all processes of BCP.
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.
void purge_ptr_vector_by_index(BCP_vec< T * > &pvec, typename BCP_vec< int >::const_iterator first, typename BCP_vec< int >::const_iterator last)
This function purges the entries indexed by [first,last) from the vector of pointers pvec...
BCP_vec< BCP_cut * > new_cuts
void purge_ptr_vector(BCP_vec< T * > &pvec, typename BCP_vec< T * >::iterator first, typename BCP_vec< T * >::iterator last)
This function purges the entries [first,last) from the vector of pointers pvec.
void set_lb_ub(const BCP_vec< int > &pos, BCP_vec< double >::const_iterator bounds)
Set the lower/upper bound pairs of the entries given by the contents of pos to the values in [bounds...
double new_true_lower_bound
This class holds the results after solving an LP relaxation.
BCP_vec< BCP_row * > new_rows
iterator entry(const int i)
Return an iterator to the i-th entry.
virtual void pack_dual_solution(BCP_buffer &buf, const BCP_lp_result &lp_result, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts)
Pack the information necessary for variable generation into the buffer.
void send_feasible_solution(const BCP_solution *sol)
BCP_vec< BCP_col * > new_cols
virtual void initialize_new_search_tree_node(const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const BCP_vec< BCP_obj_status > &var_status, const BCP_vec< BCP_obj_status > &cut_status, BCP_vec< int > &var_changed_pos, BCP_vec< double > &var_new_bd, BCP_vec< int > &cut_changed_pos, BCP_vec< double > &cut_new_bd)
Initializing a new search tree node.
This class holds a row in a compressed form.
This is the abstract base class for a solution to a Mixed Integer Programming problem.