coin-Bcp
|
This class is the internal representation of a branching object. More...
#include <BCP_branch.hpp>
Public Member Functions | |
Constructors and destructor | |
BCP_internal_brobj () | |
The default constructor creates an empty internal branching object (which can be filled later by unpacking a buffer). More... | |
BCP_internal_brobj (BCP_lp_branching_object &candidate) | |
This constructor sets the number of children and copies the contents of the positions and bounds of the forced changes to the positions and bounds of the newly created internal branching object. More... | |
~BCP_internal_brobj () | |
The desctructor deletes all data members. More... | |
Query methods | |
int | child_num () const |
Return the number of children. More... | |
int | affected_varnum () const |
Return the number of affected variables. More... | |
int | affected_cutnum () const |
Return the number of affected cuts. More... | |
const BCP_vec< int > & | var_positions () const |
Return a const reference to the vector of positions of variables affected by the branching. More... | |
const BCP_vec< int > & | cut_positions () const |
Return a const reference to the vector of positions of cuts affected by the branching. More... | |
BCP_vec< double >::const_iterator | var_bounds_child (const int index) const |
Return a const iterator within _var_bounds to the location where the bound pairs for the index -th child start. More... | |
BCP_vec< double >::const_iterator | cut_bounds_child (const int index) const |
Return a const iterator within _cut_bounds to the location where the bound pairs for the index -th child start. More... | |
Interaction with the LP solver | |
void | apply_child_bounds (OsiSolverInterface *lp, int child_ind) const |
Modify the bounds in the LP solver by applying the changes specified for the child_ind -th child. More... | |
Packing and unpacking | |
void | pack (BCP_buffer &buf) const |
Pack the internal branching object into the buffer. More... | |
void | unpack (BCP_buffer &buf) |
Unpack an internal branching object from the buffer. More... | |
Private Member Functions | |
Disabled methods | |
BCP_internal_brobj (const BCP_internal_brobj &) | |
The copy constructor is declared but not defined to disable it. More... | |
BCP_internal_brobj & | operator= (const BCP_internal_brobj &) |
The assignment operator is declared but not defined to disable it. More... | |
Private Attributes | |
Data members | |
int | _child_num |
The number of children in the branching object. More... | |
BCP_vec< int > | _var_positions |
The positions of variables whose bounds are affected by the branching. More... | |
BCP_vec< int > | _cut_positions |
The positions of cuts whose bounds are affected by the branching. More... | |
BCP_vec< double > | _var_bounds |
Lower/upper bound pairs for the variables affected by the branching. More... | |
BCP_vec< double > | _cut_bounds |
Lower/upper bound pairs for the cuts affected by the branching. More... | |
This class is the internal representation of a branching object.
We document it only for the sake of completness, the user need not worry about it.
An internal branching object is created AFTER all the cuts/variables the branching object wanted to add the relaxation are already added, thus only the bound changes on affected variables are specified.
NOTE: There are only two ways to set up an internal branching object. One is through a constructor that passes on the data members, the second is to set it up with the default constructor then unpack its content from a buffer.
Definition at line 31 of file BCP_branch.hpp.
|
private |
The copy constructor is declared but not defined to disable it.
|
inline |
The default constructor creates an empty internal branching object (which can be filled later by unpacking a buffer).
Definition at line 66 of file BCP_branch.hpp.
BCP_internal_brobj::BCP_internal_brobj | ( | BCP_lp_branching_object & | candidate | ) |
This constructor sets the number of children and copies the contents of the positions and bounds of the forced changes to the positions and bounds of the newly created internal branching object.
|
inline |
The desctructor deletes all data members.
Definition at line 73 of file BCP_branch.hpp.
|
private |
The assignment operator is declared but not defined to disable it.
|
inline |
|
inline |
Return the number of affected variables.
Definition at line 81 of file BCP_branch.hpp.
References _var_positions, and BCP_vec< T >::size().
|
inline |
Return the number of affected cuts.
Definition at line 83 of file BCP_branch.hpp.
References _cut_positions, and BCP_vec< T >::size().
|
inline |
Return a const
reference to the vector of positions of variables affected by the branching.
Definition at line 87 of file BCP_branch.hpp.
References _var_positions.
|
inline |
Return a const
reference to the vector of positions of cuts affected by the branching.
Definition at line 90 of file BCP_branch.hpp.
References _cut_positions.
|
inline |
Return a const
iterator within _var_bounds
to the location where the bound pairs for the index
-th child start.
Definition at line 96 of file BCP_branch.hpp.
References _var_bounds, _var_positions, BCP_vec< T >::entry(), and BCP_vec< T >::size().
|
inline |
Return a const
iterator within _cut_bounds
to the location where the bound pairs for the index
-th child start.
Definition at line 103 of file BCP_branch.hpp.
References _cut_bounds, _cut_positions, BCP_vec< T >::entry(), and BCP_vec< T >::size().
void BCP_internal_brobj::apply_child_bounds | ( | OsiSolverInterface * | lp, |
int | child_ind | ||
) | const |
Modify the bounds in the LP solver by applying the changes specified for the child_ind
-th child.
void BCP_internal_brobj::pack | ( | BCP_buffer & | buf | ) | const |
Pack the internal branching object into the buffer.
void BCP_internal_brobj::unpack | ( | BCP_buffer & | buf | ) |
Unpack an internal branching object from the buffer.
|
private |
The number of children in the branching object.
Definition at line 45 of file BCP_branch.hpp.
Referenced by child_num().
|
private |
The positions of variables whose bounds are affected by the branching.
Affected means that in at least one child the lower and/or upper bound of the variable changes.
Definition at line 49 of file BCP_branch.hpp.
Referenced by affected_varnum(), var_bounds_child(), and var_positions().
|
private |
The positions of cuts whose bounds are affected by the branching.
Definition at line 51 of file BCP_branch.hpp.
Referenced by affected_cutnum(), cut_bounds_child(), and cut_positions().
|
private |
Lower/upper bound pairs for the variables affected by the branching.
The bound pairs are listed in the first child for all the affected variables, then the same data for the second child, etc. Thus the vector is of length 2*_child_num *_var_positions.size()
.
Definition at line 56 of file BCP_branch.hpp.
Referenced by var_bounds_child().
|
private |
Lower/upper bound pairs for the cuts affected by the branching.
Definition at line 58 of file BCP_branch.hpp.
Referenced by cut_bounds_child().