coin-Bcp
BCP_branch.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef _BCP_BRANCH_H
4 #define _BCP_BRANCH_H
5 
6 // This file is fully docified.
7 
8 #include "BCP_vector.hpp"
9 
10 class OsiSolverInterface;
11 class BCP_buffer;
13 
14 //#############################################################################
15 
32 private:
41 private:
56  BCP_vec<double> _var_bounds; // 2*_child_num*_var_positions.size()
61 public:
79  inline int child_num() const { return _child_num; }
81  inline int affected_varnum() const { return _var_positions.size(); }
83  inline int affected_cutnum() const { return _cut_positions.size(); }
84 
87  inline const BCP_vec<int>& var_positions() const { return _var_positions; }
90  inline const BCP_vec<int>& cut_positions() const { return _cut_positions; }
91 
95  inline
97  return _var_bounds.entry(2 * _var_positions.size() * index);
98  }
102  inline
104  return _cut_bounds.entry(2 * _cut_positions.size() * index);
105  }
112  void apply_child_bounds(OsiSolverInterface* lp, int child_ind) const;
118  void pack(BCP_buffer& buf) const;
120  void unpack(BCP_buffer& buf);
122 };
123 
124 #endif
125 
BCP_vec< int > _cut_positions
The positions of cuts whose bounds are affected by the branching.
Definition: BCP_branch.hpp:51
~BCP_internal_brobj()
The desctructor deletes all data members.
Definition: BCP_branch.hpp:73
BCP_internal_brobj()
The default constructor creates an empty internal branching object (which can be filled later by unpa...
Definition: BCP_branch.hpp:66
const BCP_vec< int > & var_positions() const
Return a const reference to the vector of positions of variables affected by the branching.
Definition: BCP_branch.hpp:87
int child_num() const
Return the number of children.
Definition: BCP_branch.hpp:79
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 chi...
Definition: BCP_branch.hpp:103
const BCP_vec< int > & cut_positions() const
Return a const reference to the vector of positions of cuts affected by the branching.
Definition: BCP_branch.hpp:90
BCP_vec< double > _cut_bounds
Lower/upper bound pairs for the cuts affected by the branching.
Definition: BCP_branch.hpp:58
This class is the internal representation of a branching object.
Definition: BCP_branch.hpp:31
void unpack(BCP_buffer &buf)
Unpack an internal branching object from the buffer.
BCP_vec< double > _var_bounds
Lower/upper bound pairs for the variables affected by the branching.
Definition: BCP_branch.hpp:56
int affected_cutnum() const
Return the number of affected cuts.
Definition: BCP_branch.hpp:83
This class describes a generic branching object.
BCP_internal_brobj & operator=(const BCP_internal_brobj &)
The assignment operator is declared but not defined to disable it.
Abstract Base Class for describing an interface to a solver.
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 chi...
Definition: BCP_branch.hpp:96
BCP_vec< int > _var_positions
The positions of variables whose bounds are affected by the branching.
Definition: BCP_branch.hpp:49
size_t size() const
Return the current number of entries.
Definition: BCP_vector.hpp:116
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
void pack(BCP_buffer &buf) const
Pack the internal branching object into the buffer.
iterator entry(const int i)
Return an iterator to the i-th entry.
Definition: BCP_vector.hpp:109
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...
int _child_num
The number of children in the branching object.
Definition: BCP_branch.hpp:45
int affected_varnum() const
Return the number of affected variables.
Definition: BCP_branch.hpp:81