Bcp 1.4.4
Loading...
Searching...
No Matches
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
11class BCP_buffer;
13
14//#############################################################################
15
32private:
38 BCP_internal_brobj& operator=(const BCP_internal_brobj&);
41private:
45 int _child_num;
49 BCP_vec<int> _var_positions;
51 BCP_vec<int> _cut_positions;
56 BCP_vec<double> _var_bounds; // 2*_child_num*_var_positions.size()
58 BCP_vec<double> _cut_bounds;
61public:
66 BCP_internal_brobj() : _child_num(0),
67 _var_positions(), _cut_positions(), _var_bounds(), _cut_bounds() {}
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
This class describes the message buffer used for all processes of BCP.
This class is the internal representation of a branching object.
int affected_varnum() const
Return the number of affected variables.
const BCP_vec< int > & cut_positions() const
Return a const reference to the vector of positions of cuts affected by the branching.
void pack(BCP_buffer &buf) const
Pack the internal branching object into the buffer.
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...
BCP_internal_brobj()
The default constructor creates an empty internal branching object (which can be filled later by unpa...
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...
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.
~BCP_internal_brobj()
The desctructor deletes all data members.
int child_num() const
Return the number of children.
void unpack(BCP_buffer &buf)
Unpack an internal branching object from the buffer.
const BCP_vec< int > & var_positions() const
Return a const reference to the vector of positions of variables affected by the branching.
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 t...
int affected_cutnum() const
Return the number of affected cuts.
This class describes a generic branching object.
The class BCP_vec serves the same purpose as the vector class in the standard template library.
const T * const_iterator
size_t size() const
Return the current number of entries.
iterator entry(const int i)
Return an iterator to the i-th entry.