coin-Bcp
|
This class is just a collection of pointers to variables with a number of methods to manipulate these variables and/or select certain entries. More...
#include <BCP_var.hpp>
Public Member Functions | |
Constructor and destructor | |
BCP_var_set () | |
The default constructor creates a variable set with no variables in it. More... | |
~BCP_var_set () | |
The destructor empties the variable set. More... | |
Modifying methods | |
void | append (const BCP_vec< BCP_var * > &x) |
Append the variables in the vector x to the end of the variable set. More... | |
void | append (BCP_var_set::const_iterator first, BCP_var_set::const_iterator last) |
Append the variables in [first, last) to the end of the variable 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 > &vc) |
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 > &vc) |
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 variables from the variable set | |
void | deletable (const int bvarnum, BCP_vec< int > &collection) |
Collect the indices of the variables marked to be removed. More... | |
![]() | |
BCP_vec () | |
The default constructor initializes the data members as 0 pointers. More... | |
BCP_vec (const BCP_vec< BCP_var * > &x) | |
The copy constructor copies over the content of x . More... | |
BCP_vec (const size_t n, const_reference value=BCP_var *()) | |
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_var **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_var * > &x) |
Exchange the contents of the object with that of x . More... | |
BCP_vec< BCP_var * > & | operator= (const BCP_vec< BCP_var * > &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_var * > &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_var * > &values) |
Update those entries listed in positions to the given values . More... | |
void | unchecked_update (const BCP_vec< int > &positions, const BCP_vec< BCP_var * > &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_var_set (const BCP_var_set &) | |
The copy constructor is declared but not defined to disable it. More... | |
BCP_var_set & | operator= (const BCP_var_set &) |
The assignment operator is declared but not defined to disable it. More... | |
Additional Inherited Members | |
![]() | |
typedef size_t | size_type |
typedef BCP_var * | value_type |
typedef BCP_var ** | iterator |
typedef const BCP_var ** | const_iterator |
typedef BCP_var *& | reference |
typedef const BCP_var *& | 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 variables with a number of methods to manipulate these variables and/or select certain entries.
Definition at line 316 of file BCP_var.hpp.
|
private |
The copy constructor is declared but not defined to disable it.
|
inline |
The default constructor creates a variable set with no variables in it.
Definition at line 331 of file BCP_var.hpp.
|
inline |
The destructor empties the variable set.
NOTE: the destructor does NOT delete the variables the members of the variable set point to.
Definition at line 335 of file BCP_var.hpp.
|
private |
The assignment operator is declared but not defined to disable it.
Append the variables in the vector x
to the end of the variable set.
Definition at line 342 of file BCP_var.hpp.
References BCP_vec< T >::append().
|
inline |
Append the variables in [first, last)
to the end of the variable set.
Definition at line 347 of file BCP_var.hpp.
References BCP_vec< T >::append().
void BCP_var_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_var_set::set_lb_ub_st | ( | const BCP_vec< BCP_obj_change > & | vc | ) |
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 variable set is all the variables in the current formulation and we want to change the triplets for the core variables, which are at the beginning of that variable set.
void BCP_var_set::set_lb_ub_st | ( | BCP_vec< int >::const_iterator | pos, |
const BCP_vec< BCP_obj_change > & | vc | ||
) |
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_var_set::deletable | ( | const int | bvarnum, |
BCP_vec< int > & | collection | ||
) |
Collect the indices of the variables marked to be removed.
Since core variables are never removed, we pass the number of core variables in the first argument to speed up things a little.