10 #include "OsiSolverInterface.hpp"
11 #include "OsiAuxInfo.hpp"
12 #include "OsiBranchingObject.hpp"
13 #include "OsiChooseVariable.hpp"
123 void print(
const bool ifprint,
const char * format, ...)
const;
233 virtual OsiSolverInterface *
297 bool in_strong_branching);
330 const double old_lower_bound,
331 double& true_lower_bound,
398 const double etol)
const;
403 const double etol)
const;
407 const double etol)
const;
521 const bool final_lp_solution);
533 const std::vector<double*> dual_rays,
655 const bool before_fathom,
686 const bool before_fathom,
692 const bool before_fathom,
718 const int var_bound_changes_since_logical_fixing,
775 bool force_branch =
false);
780 OsiSolverInterface* solver,
781 OsiChooseVariable* choose,
782 OsiBranchingObject*& branchObject,
791 const int to_be_selected,
801 const int to_be_selected,
BCP_object_origin
This enumerative constant describes the origin (originating process) of an object (variable or cut)...
char get_param(const BCP_lp_par::chr_params key) const
int_params
Integer parameters.
BCP_message_tag
This enumerative constant describes the message tags different processes of BCP understand.
This class describes the core of the MIP problem, the variables/cuts in it as well as the matrix corr...
str_params
String parameters.
void setOsiBabSolver(OsiBabSolver *ptr)
void branch_close_to_one(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const int to_be_selected, const double etol, BCP_vec< BCP_lp_branching_object * > &candidates)
Select the "close-to-one" variables for strong branching.
void print(const bool ifprint, const char *format,...) const
A method to print a message with the process id.
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.
int parent() const
the process id of the parent
virtual void process_message(BCP_buffer &buf)
Process a message that has been sent by another process' user part to this process' user part...
virtual OsiSolverInterface * initialize_solver_interface()
Create LP solver environment.
void select_fractions(const double *first, const double *last, const double etol, BCP_vec< int > &fractions) const
Select all fractional entries.
void reduced_cost_fixing(const double *dj, const double *x, const double gap, BCP_vec< BCP_var * > &vars, int &newly_changed)
Reduced cost fixing.
Abstract base class that defines members common to all types of cuts.
virtual BCP_branching_object_relation compare_branching_candidates(BCP_presolved_lp_brobj *new_solved, BCP_presolved_lp_brobj *old_solved)
Decide which branching object is preferred for branching.
OsiBabSolver * getOsiBabSolver()
BCP_process_t
This enumerative constant describes the various process types.
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.
void set_param(const BCP_lp_par::chr_params key, const bool val)
int current_level() const
Return the level of the search tree node being processed.
BCP_lp_user & operator=(const BCP_lp_user &)
virtual void generate_vars_in_lp(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const bool before_fathom, BCP_vec< BCP_var * > &new_vars, BCP_vec< BCP_col * > &new_cols)
Generate variables within the LP process.
int current_index() const
Return the internal index of the search tree node being processed.
double start_time() const
Return when the LP process started.
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)...
This class is just a collection of pointers to cuts with a number of methods to manipulate these cuts...
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.
int current_iteration() const
Return the iteration count within the search tree node being processed.
This class is a very simple impelementation of a constant length string.
int current_phase() const
Return the phase the algorithm is in.
The BCP_lp_user class is the base class from which the user can derive a problem specific class to be...
void broadcast_message(const BCP_process_t proc_type, const BCP_buffer &buf)
Broadcast the message to all processes of the given type.
BCP_solution_generic * test_integral(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const double etol) const
Test whether all variables are integer.
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.
void send_message(const int target, const BCP_buffer &buf, BCP_message_tag tag=BCP_Msg_User)
Send a message to a particular process.
void branch_close_to_half(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const int to_be_selected, const double etol, BCP_vec< BCP_lp_branching_object * > &candidates)
Select the "close-to-half" variables for strong branching.
virtual void restore_feasibility(const BCP_lp_result &lpres, const std::vector< double * > dual_rays, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_var * > &vars_to_add, BCP_vec< BCP_col * > &cols_to_add)
Restoring feasibility.
virtual void set_actions_for_children(BCP_presolved_lp_brobj *best)
Decide what to do with the children of the selected branching object.
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.
BCP_user_data * get_user_data()
Return a pointer to the BCP_user_data structure the user (may have) stored in this node...
virtual BCP_object_compare_result compare_vars(const BCP_var *v0, const BCP_var *v1)
Compare two generated variables.
void fint fint fint real fint real real real real real real real real real fint real fint * lp
BCP_lp_prob * getLpProblemPointer()
Get the pointer.
virtual BCP_branching_decision select_branching_candidates(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const BCP_lp_var_pool &local_var_pool, const BCP_lp_cut_pool &local_cut_pool, BCP_vec< BCP_lp_branching_object * > &cands, bool force_branch=false)
Decide whether to branch or not and select a set of branching candidates if branching is decided upon...
virtual BCP_object_compare_result compare_cuts(const BCP_cut *c0, const BCP_cut *c1)
Compare two generated cuts.
void append_branching_vars(const double *x, const BCP_vec< BCP_var * > &vars, const BCP_vec< int > &select_pos, BCP_vec< BCP_lp_branching_object * > &candidates)
This helper method creates branching variable candidates and appends them to cans.
BCP_solution_generic * test_binary(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const double etol) const
Test whether all variables are 0/1.
void select_positives(const double *first, const double *last, const double etol, BCP_vec< int > &positives) const
Select all positive entries.
virtual BCP_solution * generate_heuristic_solution(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts)
Try to generate a heuristic solution (or return one generated during cut/variable generation...
virtual void unpack_module_data(BCP_buffer &buf)
Unpack the initial information sent to the LP process by the Tree Manager.
BCP_lp_user()
Being virtual, the destructor invokes the destructor for the real type of the object being deleted...
BCP_branching_decision
This enumerative constant is the return value of the select_branching_candidates() method in [BCP_lp_...
chr_params
Character parameters.
void setLpProblemPointer(BCP_lp_prob *ptr)
Set the pointer.
OsiBabSolver * babSolver_
virtual void select_vars_to_delete(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const bool before_fathom, BCP_vec< int > &deletable)
virtual void logical_fixing(const BCP_lp_result &lpres, 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, const int var_bound_changes_since_logical_fixing, BCP_vec< int > &changed_pos, BCP_vec< double > &new_bd)
This method provides an opportunity for the user to tighten the bounds of variables.
double upper_bound() const
Return what is the best known upper bound (might be BCP_DBL_MAX)
Abstract base class that defines members common to all types of variables.
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.
virtual void display_lp_solution(const BCP_lp_result &lp_result, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const bool final_lp_solution)
Display the result of most recent LP optimization.
A presolved branching object candidate.
virtual ~BCP_lp_user()
Being virtual, the destructor invokes the destructor for the real type of the object being deleted...
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...
virtual int try_to_branch(OsiBranchingInformation &branchInfo, OsiSolverInterface *solver, OsiChooseVariable *choose, OsiBranchingObject *&branchObject, bool allowVarFix)
Select the "close-to-half" variables for strong branching.
virtual void select_cuts_to_delete(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const bool before_fathom, BCP_vec< int > &deletable)
void receive_message(const int sender, BCP_buffer &buf, BCP_message_tag tag=BCP_Msg_User)
Wait for a message and receive it.
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.
void select_zeros(const double *first, const double *last, const double etol, BCP_vec< int > &zeros) const
Select all zero entries.
This class is just a collection of pointers to variables with a number of methods to manipulate these...
virtual void set_user_data_for_children(BCP_presolved_lp_brobj *best, const int selected)
For each child create a user data object and put it into the appropriate entry in best->user_data()...
This class describes the message buffer used for all processes of BCP.
BCP_branching_object_relation
This enumerative constant is the return value of the compare_presolved_branching_objects() method in ...
Used by the user to send a message to the user portion of the other process.
This class holds the results after solving an LP relaxation.
bool over_ub(double lb) const
Return true / false depending on whether the lb argument is over the current upper bound or not...
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.
virtual void load_problem(OsiSolverInterface &osi, BCP_problem_core *core, BCP_var_set &vars, BCP_cut_set &cuts)
Load the problem specified by core, vars, and cuts into the solver interface.
virtual void pack_feasible_solution(BCP_buffer &buf, const BCP_solution *sol)
Pack a MIP feasible solution into a buffer.
This class holds a MIP feasible primal solution.
void send_feasible_solution(const BCP_solution *sol)
virtual void modify_lp_parameters(OsiSolverInterface *lp, const int changeType, bool in_strong_branching)
Modify parameters of the LP solver before optimization.
dbl_params
Double parameters.
BCP_object_compare_result
This enumerative constant describes the possible outcomes when comparing two objects (variables or cu...
void select_nonzeros(const double *first, const double *last, const double etol, BCP_vec< int > &nonzeros) const
Select all nonzero entries.
BCP_solution_generic * test_full(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const double etol) const
Test whether the variables specified as integers are really integer.
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.
void fint fint fint real fint real * x
This is the abstract base class for a solution to a Mixed Integer Programming problem.
int process_id() const
What is the process id of the current process.
bool using_deprecated_set_user_data_for_children