This class describes a generic branching object. More...
#include <BCP_lp_branch.hpp>
Public Member Functions | |
Constructor and destructor | |
BCP_lp_branching_object (const int children, BCP_vec< BCP_var * > *const new_vars, BCP_vec< BCP_cut * > *const new_cuts, const BCP_vec< int > *const fvp, const BCP_vec< int > *const fcp, const BCP_vec< double > *const fvb, const BCP_vec< double > *const fcb, const BCP_vec< int > *const ivp, const BCP_vec< int > *const icp, const BCP_vec< double > *const ivb, const BCP_vec< double > *const icb) | |
The constructor makes a copy of each vector passed to it. | |
~BCP_lp_branching_object () | |
The destructor deletes each vector. | |
Query methods | |
int | vars_affected () const |
Return the number of variables whose bounds are affected by the branching. | |
int | cuts_affected () const |
Return the number of cuts whose bounds are affected by the branching. | |
int | vars_added () const |
Return the number of variables added in the branching. | |
int | cuts_added () const |
Return the number of cuts added in the branching. | |
BCP_vec< double >::const_iterator | forced_var_bd_child (const int index) const |
Return a const iterator to the position in the forced variable bound changes where the new bounds for the index -th child start. | |
BCP_vec< double >::const_iterator | forced_cut_bd_child (const int index) const |
Return a const iterator to the position in the forced cut bound changes where the new bounds for the index -th child start. | |
BCP_vec< double >::const_iterator | implied_var_bd_child (const int index) const |
Return a const iterator to the position in the implied variable bound changes where the new bounds for the index -th child start. | |
BCP_vec< double >::const_iterator | implied_cut_bd_child (const int index) const |
Return a const iterator to the position in the implied cut bound changes where the new bounds for the index -th child start. | |
Modifying methods | |
void | init_pos_for_added (const int added_vars_start, const int added_cuts_start) |
This method "cleans up" the positions and bounds. | |
void | apply_child_bd (OsiSolverInterface *lp, const int child_ind) const |
This method invokes the appropriate methods of lp to apply the forced and implied bound changes of the child_ind -th child. | |
void | print_branching_info (const int orig_varnum, const double *x, const double *obj) const |
This method prints out some information about the branching object. | |
Public Attributes | |
Data members | |
int | child_num |
The number of children for this branching object. | |
BCP_vec< BCP_var * > * | vars_to_add |
Variables to be added to the formulation. | |
BCP_vec< BCP_cut * > * | cuts_to_add |
Cuts to be added to the formulation. | |
Data members referring to forced bound changes. "Forced" means | |
BCP_vec< int > * | forced_var_pos |
Positions of variables whose bounds change ("forcibly", by branching) in the children. | |
BCP_vec< int > * | forced_cut_pos |
Positions of cutss whose bounds change ("forcibly", by branching) in the children. | |
BCP_vec< double > * | forced_var_bd |
Contains the actual bounds for the variables indexed by forced_var_pos . | |
BCP_vec< double > * | forced_cut_bd |
Contains the actual bounds for the cuts indexed by forced_cut_pos . | |
Data members referring to implied bound changes. "Implied" means | |
that these changes could be made by applying the forced changes and then doing logical fixing. Therefore this information is not recorded in the Tree Manager when it stores the branching rule. However, if there are implied changes, it is useful to specify them, because strong branching may be more effecive then. The interpretation of these data members is identical to their forced counterparts. | |
BCP_vec< int > * | implied_var_pos |
BCP_vec< int > * | implied_cut_pos |
BCP_vec< double > * | implied_var_bd |
BCP_vec< double > * | implied_cut_bd |
Private Member Functions | |
Disabled methods | |
BCP_lp_branching_object (const BCP_lp_branching_object &) | |
The copy constructor is declared but not defined to disable it. | |
BCP_lp_branching_object & | operator= (const BCP_lp_branching_object &) |
The assignment operator is declared but not defined to disable it. |
This class describes a generic branching object.
The object may contain variables and cuts to be added to the formulation and it contains the bound changes for each child.
Note that it is unlikely that the user would need any of the member functions. She should simply call its constructor to create the object. The rest is internal to BCP.
Definition at line 45 of file BCP_lp_branch.hpp.
BCP_lp_branching_object::BCP_lp_branching_object | ( | const BCP_lp_branching_object & | ) | [private] |
The copy constructor is declared but not defined to disable it.
BCP_lp_branching_object::BCP_lp_branching_object | ( | const int | children, | |
BCP_vec< BCP_var * > *const | new_vars, | |||
BCP_vec< BCP_cut * > *const | new_cuts, | |||
const BCP_vec< int > *const | fvp, | |||
const BCP_vec< int > *const | fcp, | |||
const BCP_vec< double > *const | fvb, | |||
const BCP_vec< double > *const | fcb, | |||
const BCP_vec< int > *const | ivp, | |||
const BCP_vec< int > *const | icp, | |||
const BCP_vec< double > *const | ivb, | |||
const BCP_vec< double > *const | icb | |||
) | [inline, explicit] |
The constructor makes a copy of each vector passed to it.
If a 0 pointer is passed for one of the arguments that means that the vector is empty. new_{vars,cuts}
contains the variables/cuts to be added and [fi][vc][pb]
contains the forced/implied variable/cut positions/bounds.
Definition at line 119 of file BCP_lp_branch.hpp.
BCP_lp_branching_object::~BCP_lp_branching_object | ( | ) | [inline] |
The destructor deletes each vector.
Definition at line 172 of file BCP_lp_branch.hpp.
BCP_lp_branching_object& BCP_lp_branching_object::operator= | ( | const BCP_lp_branching_object & | ) | [private] |
The assignment operator is declared but not defined to disable it.
int BCP_lp_branching_object::vars_affected | ( | ) | const [inline] |
Return the number of variables whose bounds are affected by the branching.
(Including both forced and implied changes.)
Definition at line 185 of file BCP_lp_branch.hpp.
int BCP_lp_branching_object::cuts_affected | ( | ) | const [inline] |
Return the number of cuts whose bounds are affected by the branching.
(Including both forced and implied changes.)
Definition at line 192 of file BCP_lp_branch.hpp.
int BCP_lp_branching_object::vars_added | ( | ) | const [inline] |
Return the number of variables added in the branching.
Definition at line 198 of file BCP_lp_branch.hpp.
int BCP_lp_branching_object::cuts_added | ( | ) | const [inline] |
Return the number of cuts added in the branching.
Definition at line 202 of file BCP_lp_branch.hpp.
BCP_vec<double>::const_iterator BCP_lp_branching_object::forced_var_bd_child | ( | const int | index | ) | const [inline] |
Return a const iterator to the position in the forced variable bound changes where the new bounds for the index
-th child start.
This method should be invoked only if the appropriate data member is non-0.
Definition at line 210 of file BCP_lp_branch.hpp.
BCP_vec<double>::const_iterator BCP_lp_branching_object::forced_cut_bd_child | ( | const int | index | ) | const [inline] |
Return a const iterator to the position in the forced cut bound changes where the new bounds for the index
-th child start.
This method should be invoked only if the appropriate data member is non-0.
Definition at line 218 of file BCP_lp_branch.hpp.
BCP_vec<double>::const_iterator BCP_lp_branching_object::implied_var_bd_child | ( | const int | index | ) | const [inline] |
Return a const iterator to the position in the implied variable bound changes where the new bounds for the index
-th child start.
This method should be invoked only if the appropriate data member is non-0.
Definition at line 226 of file BCP_lp_branch.hpp.
BCP_vec<double>::const_iterator BCP_lp_branching_object::implied_cut_bd_child | ( | const int | index | ) | const [inline] |
Return a const iterator to the position in the implied cut bound changes where the new bounds for the index
-th child start.
This method should be invoked only if the appropriate data member is non-0.
Definition at line 234 of file BCP_lp_branch.hpp.
void BCP_lp_branching_object::init_pos_for_added | ( | const int | added_vars_start, | |
const int | added_cuts_start | |||
) |
This method "cleans up" the positions and bounds.
First it re-indexes the negative positions starting from added_vars_start
for the variables (and from added_cuts_start
for the cuts). Then it reorders the positions (and follows that ordering with the bounds) so that the positions will be in increasing order.
void BCP_lp_branching_object::apply_child_bd | ( | OsiSolverInterface * | lp, | |
const int | child_ind | |||
) | const |
This method invokes the appropriate methods of lp
to apply the forced and implied bound changes of the child_ind
-th child.
void BCP_lp_branching_object::print_branching_info | ( | const int | orig_varnum, | |
const double * | x, | |||
const double * | obj | |||
) | const |
This method prints out some information about the branching object.
(The positions, new bounds, the primal value of the variables.)
The number of children for this branching object.
Definition at line 59 of file BCP_lp_branch.hpp.
Variables to be added to the formulation.
Definition at line 61 of file BCP_lp_branch.hpp.
Cuts to be added to the formulation.
Definition at line 63 of file BCP_lp_branch.hpp.
Positions of variables whose bounds change ("forcibly", by branching) in the children.
If a position is non-negative, it refers to a variable in the current LP formulation. If a position is negative (-i), it refers to an added variable (i-1st).
Definition at line 72 of file BCP_lp_branch.hpp.
Positions of cutss whose bounds change ("forcibly", by branching) in the children.
If a position is non-negative, it refers to a cut in the current LP formulation. If a position is negative (-i), it refers to an added cut (i-1st).
Definition at line 77 of file BCP_lp_branch.hpp.
Contains the actual bounds for the variables indexed by forced_var_pos
.
List the lower/upper bound pairs for each of the variables, for each child in turn. The length of this vector is thus child_num * 2 * forced_var_pos.size()
.
Definition at line 82 of file BCP_lp_branch.hpp.
Contains the actual bounds for the cuts indexed by forced_cut_pos
.
List the lower/upper bound pairs for each of the cuts, for each child in turn. The length of this vector is thus child_num * 2 * forced_cut_pos.size()
.
Definition at line 87 of file BCP_lp_branch.hpp.
Definition at line 101 of file BCP_lp_branch.hpp.
Definition at line 103 of file BCP_lp_branch.hpp.
Definition at line 105 of file BCP_lp_branch.hpp.
Definition at line 107 of file BCP_lp_branch.hpp.