coin-Bcp
|
This class is just a collection of pointers to cuts with a number of methods to manipulate these cuts and/or select certain entries. More...
#include <BCP_cut.hpp>
Public Member Functions | |
Constructor and destructor | |
BCP_cut_set () | |
The default constructor creates a cut set with no cuts in it. More... | |
~BCP_cut_set () | |
The destructor empties the cut set. More... | |
Modifying methods | |
void | append (const BCP_vec< BCP_cut * > &x) |
Append the cuts in the vector x to the end of the cut set. More... | |
void | append (BCP_cut_set::const_iterator first, BCP_cut_set::const_iterator last) |
Append the cuts in [first, last) to the end of the cut set. More... | |
void | set_lb_ub (const BCP_vec< int > &pos, BCP_vec< double >::const_iterator bounds) |
Set the lower/upper bound pairs of the entries given by the contents of pos to the values in [bounds, bounds + pos . More... | |
void | set_lb_ub_st (const BCP_vec< BCP_obj_change > &cc) |
Set the lower/upper bound pairs and the stati of the first cc . More... | |
void | set_lb_ub_st (BCP_vec< int >::const_iterator pos, const BCP_vec< BCP_obj_change > &cc) |
Set the lower/upper bound pairs and the stati of the entries given by the content of [pos, pos + cc . More... | |
Methods related to deleting cuts from the cut set | |
void | move_deletable_to_pool (const BCP_vec< int > &deletable_cuts, BCP_vec< BCP_cut * > &pool) |
Move the cut pointers whose indices are listed in deletable_cuts into the pool . More... | |
![]() | |
BCP_vec () | |
The default constructor initializes the data members as 0 pointers. More... | |
BCP_vec (const BCP_vec< BCP_cut * > &x) | |
The copy constructor copies over the content of x . More... | |
BCP_vec (const size_t n, const_reference value=BCP_cut *()) | |
Construct a BCP_vec with n elements, all initialized with the second argument (or initialized with the default constructor of T if the second argument is missing). More... | |
BCP_vec (const_iterator first, const_iterator last) | |
Construct a BCP_vec by copying the elements from first to last-1 . More... | |
BCP_vec (const BCP_cut **x, const size_t num) | |
Construct a BCP_vec by copying num objects of type T from the memory starting at x . More... | |
virtual | ~BCP_vec () |
The destructor deallocates the memory allocated for the BCP_vec . More... | |
iterator | begin () |
Return an iterator to the beginning of the object. More... | |
const_iterator | begin () const |
Return a const iterator to the beginning of the object. More... | |
iterator | end () |
Return an iterator to the end of the object. More... | |
const_iterator | end () const |
Return a const iterator to the end of the object. More... | |
iterator | entry (const int i) |
Return an iterator to the i -th entry. More... | |
const_iterator | entry (const int i) const |
Return a const iterator to the i -th entry. More... | |
size_t | index (const_iterator pos) const |
Return the index of the entry pointed to by pos . More... | |
size_t | size () const |
Return the current number of entries. More... | |
size_t | capacity () const |
Return the capacity of the object (space allocated for this many entries). More... | |
bool | empty () const |
Test if there are any entries in the object. More... | |
reference | operator[] (const size_t i) |
Return a reference to the i -th entry. More... | |
const_reference | operator[] (const size_t i) const |
Return a const reference to the i -th entry. More... | |
reference | front () |
Return a reference to the first entry. More... | |
const_reference | front () const |
Return a const reference to the first entry. More... | |
reference | back () |
Return a reference to the last entry. More... | |
const_reference | back () const |
Return a const reference to the last entry. More... | |
void | reserve (const size_t n) |
Reallocate the object to make space for n entries. More... | |
void | swap (BCP_vec< BCP_cut * > &x) |
Exchange the contents of the object with that of x . More... | |
BCP_vec< BCP_cut * > & | operator= (const BCP_vec< BCP_cut * > &x) |
Copy the contents of x into the object and return a reference the the object itself. More... | |
void | assign (const void *x, const size_t num) |
Copy num entries of type T starting at the memory location x into the object. More... | |
void | insert (iterator position, const void *first, const size_t num) |
Insert num entries starting from memory location first into the vector from position pos . More... | |
void | insert (iterator position, const_iterator first, const_iterator last) |
Insert the entries [first,last) into the vector from position pos . More... | |
void | insert (iterator position, const size_t n, const_reference x) |
Insert n copies of x into the vector from position pos . More... | |
iterator | insert (iterator position, const_reference x) |
Insert x (a single entry) into the vector at position pos . More... | |
void | append (const BCP_vec< BCP_cut * > &x) |
Append the entries in x to the end of the vector. More... | |
void | append (const_iterator first, const_iterator last) |
Append the entries [first,last) to the end of the vector. More... | |
void | push_back (const_reference x) |
Append x to the end of the vector. More... | |
void | unchecked_push_back (const_reference x) |
Append x to the end of the vector. More... | |
void | pop_back () |
Delete the last entry. More... | |
void | clear () |
Delete every entry. More... | |
void | update (const BCP_vec< int > &positions, const BCP_vec< BCP_cut * > &values) |
Update those entries listed in positions to the given values . More... | |
void | unchecked_update (const BCP_vec< int > &positions, const BCP_vec< BCP_cut * > &values) |
Same as the previous method but without sanity checks. More... | |
void | keep (iterator pos) |
Keep only the entry pointed to by pos . More... | |
void | keep (iterator first, iterator last) |
Keep the entries [first,last) . More... | |
void | keep_by_index (const BCP_vec< int > &positions) |
Keep the entries indexed by indices . More... | |
void | keep_by_index (const int *firstpos, const int *lastpos) |
Keep the entries indexed by the values in [firstpos,lastpos) . More... | |
void | unchecked_keep_by_index (const BCP_vec< int > &positions) |
Same as the previous method but without the sanity checks. More... | |
void | unchecked_keep_by_index (const int *firstpos, const int *lastpos) |
Same as the previous method but without the sanity checks. More... | |
void | erase (iterator pos) |
Erase the entry pointed to by pos . More... | |
void | erase (iterator first, iterator last) |
Erase the entries [first,last) . More... | |
void | erase_by_index (const BCP_vec< int > &positions) |
Erase the entries indexed by indices . More... | |
void | erase_by_index (const int *firstpos, const int *lastpos) |
Like the other erase_by_index method (including sanity checks), just the indices of the entries to be erased are given in [firstpos,lastpos) . More... | |
void | unchecked_erase_by_index (const BCP_vec< int > &positions) |
Same as the previous method but without the sanity check. More... | |
void | unchecked_erase_by_index (const int *firstpos, const int *lastpos) |
Same as the previous method but without the sanity checks. More... | |
Private Member Functions | |
Disabled methods | |
BCP_cut_set (const BCP_cut_set &) | |
The copy constructor is declared but not defined to disable it. More... | |
BCP_cut_set & | operator= (const BCP_cut_set &) |
The assignment operator is declared but not defined to disable it. More... | |
Additional Inherited Members | |
![]() | |
typedef size_t | size_type |
typedef BCP_cut * | value_type |
typedef BCP_cut ** | iterator |
typedef const BCP_cut ** | const_iterator |
typedef BCP_cut *& | reference |
typedef const BCP_cut *& | const_reference |
![]() | |
iterator | allocate (size_t len) |
allocate raw, uninitialized memory for len entries. More... | |
void | deallocate () |
Destroy the entries in the vector and free the memory allocated for the vector. More... | |
void | insert_aux (iterator position, const_reference x) |
insert x into the given position in the vector. More... | |
![]() | |
iterator | start |
Iterator pointing to the beginning of the memory array where the vector is stored. More... | |
iterator | finish |
Iterator pointing to right after the last entry in the vector. More... | |
iterator | end_of_storage |
Iterator pointing to right after the last memory location usable by the vector without reallocation. More... | |
This class is just a collection of pointers to cuts with a number of methods to manipulate these cuts and/or select certain entries.
Definition at line 279 of file BCP_cut.hpp.
|
private |
The copy constructor is declared but not defined to disable it.
|
inline |
The default constructor creates a cut set with no cuts in it.
Definition at line 293 of file BCP_cut.hpp.
|
inline |
The destructor empties the cut set.
NOTE: the destructor does NOT delete the cuts the members of the cut set point to.
Definition at line 296 of file BCP_cut.hpp.
|
private |
The assignment operator is declared but not defined to disable it.
Append the cuts in the vector x
to the end of the cut set.
Definition at line 304 of file BCP_cut.hpp.
References BCP_vec< T >::append().
|
inline |
Append the cuts in [first, last)
to the end of the cut set.
Definition at line 309 of file BCP_cut.hpp.
References BCP_vec< T >::append().
void BCP_cut_set::set_lb_ub | ( | const BCP_vec< int > & | pos, |
BCP_vec< double >::const_iterator | bounds | ||
) |
Set the lower/upper bound pairs of the entries given by the contents of pos
to the values in [bounds, bounds + pos
.
size())
.
void BCP_cut_set::set_lb_ub_st | ( | const BCP_vec< BCP_obj_change > & | cc | ) |
Set the lower/upper bound pairs and the stati of the first cc
.
size()
entries to the triplets given in the vector. This method is invoked when the cut set is all the cuts in the current formulation and we want to change the triplets for the core cuts, which are at the beginning of that cut set.
void BCP_cut_set::set_lb_ub_st | ( | BCP_vec< int >::const_iterator | pos, |
const BCP_vec< BCP_obj_change > & | cc | ||
) |
Set the lower/upper bound pairs and the stati of the entries given by the content of [pos, pos + cc
.
size())
to the triplets contained in cc
.
void BCP_cut_set::move_deletable_to_pool | ( | const BCP_vec< int > & | deletable_cuts, |
BCP_vec< BCP_cut * > & | pool | ||
) |
Move the cut pointers whose indices are listed in deletable_cuts
into the pool
.
Note that this method does NOT compress the cut set, it merely replaces the cut pointers with 0 pointers.