3 #ifndef _BCP_VECTOR_GENERAL_H
4 #define _BCP_VECTOR_GENERAL_H
90 BCP_vec(
const T*
x,
const size_t num);
153 void assign(
const void*
x,
const size_t num);
156 void insert(
iterator position,
const void* first,
const size_t num);
217 inline void keep_by_index(
const int * firstpos,
const int * lastpos);
239 inline void erase_by_index(
const int * firstpos,
const int * lastpos);
256 return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
271 while (first != last) {
276 pvec.
erase(origfirst, last);
302 while (first != last) {
321 const int pvec_size = pvec.
size();
324 for (i = 0; i < pvec_size && first != last; ++i) {
333 for ( ; i < pvec_size; ++i) {
size_t index(const_iterator pos) const
Return the index of the entry pointed to by pos.
void deallocate()
Destroy the entries in the vector and free the memory allocated for the vector.
void insert_aux(iterator position, const_reference x)
insert x into the given position in the vector.
bool empty() const
Test if there are any entries in the object.
const_iterator entry(const int i) const
Return a const iterator to the i-th entry.
void append(const_iterator first, const_iterator last)
Append the entries [first,last) to the end of the vector.
pos
position where the operator should be printed when printing the expression
void clear()
Delete every entry.
iterator finish
Iterator pointing to right after the last entry in the vector.
const_reference operator[](const size_t i) const
Return a const reference to the i-th entry.
reference operator[](const size_t i)
Return a reference to the i-th entry.
const T & const_reference
bool operator==(const BCP_obj_change &ch0, const BCP_obj_change &ch1)
iterator begin()
Return an iterator to the beginning of the object.
void unchecked_update(const BCP_vec< int > &positions, const BCP_vec< T > &values)
Same as the previous method but without sanity checks.
void reserve(const size_t n)
Reallocate the object to make space for n entries.
size_t capacity() const
Return the capacity of the object (space allocated for this many entries).
reference back()
Return a reference to the last entry.
void push_back(const_reference x)
Append x to the end of the vector.
BCP_vec< T > & operator=(const BCP_vec< T > &x)
Copy the contents of x into the object and return a reference the the object itself.
void construct(iterator pos)
void keep_by_index(const BCP_vec< int > &positions)
Keep the entries indexed by indices.
void erase(iterator pos)
Erase the entry pointed to by pos.
virtual ~BCP_vec()
The destructor deallocates the memory allocated for the BCP_vec.
iterator end_of_storage
Iterator pointing to right after the last memory location usable by the vector without reallocation...
void pop_back()
Delete the last entry.
reference front()
Return a reference to the first entry.
iterator start
Iterator pointing to the beginning of the memory array where the vector is stored.
void erase_by_index(const BCP_vec< int > &positions)
Erase the entries indexed by indices.
void update(const BCP_vec< int > &positions, const BCP_vec< T > &values)
Update those entries listed in positions to the given values.
void destroy_range(iterator first, iterator last)
BCP_vec()
The default constructor initializes the data members as 0 pointers.
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...
size_t size() const
Return the current number of entries.
iterator end()
Return an iterator to the end of the object.
void unchecked_keep_by_index(const BCP_vec< int > &positions)
Same as the previous method but without the sanity checks.
The class BCP_vec serves the same purpose as the vector class in the standard template library...
void keep_ptr_vector_by_index(BCP_vec< T * > &pvec, typename BCP_vec< int >::const_iterator first, typename BCP_vec< int >::const_iterator last)
This function keeps only the entries indexed by [first,last) from the vector of pointers pvec...
const_iterator end() const
Return a const iterator to the end of the object.
const_iterator begin() const
Return a const iterator to the beginning of the object.
void unchecked_push_back(const_reference x)
Append x to the end of the vector.
void purge_ptr_vector_by_index(BCP_vec< T * > &pvec, typename BCP_vec< int >::const_iterator first, typename BCP_vec< int >::const_iterator last)
This function purges the entries indexed by [first,last) from the vector of pointers pvec...
void purge_ptr_vector(BCP_vec< T * > &pvec, typename BCP_vec< T * >::iterator first, typename BCP_vec< T * >::iterator last)
This function purges the entries [first,last) from the vector of pointers pvec.
const_reference back() const
Return a const reference to the last entry.
const_reference front() const
Return a const reference to the first entry.
This class holds the results after solving an LP relaxation.
iterator allocate(size_t len)
allocate raw, uninitialized memory for len entries.
iterator entry(const int i)
Return an iterator to the i-th entry.
void keep(iterator pos)
Keep only the entry pointed to by pos.
void assign(const void *x, const size_t num)
Copy num entries of type T starting at the memory location x into the object.
void append(const BCP_vec< T > &x)
Append the entries in x to the end of the vector.
void swap(BCP_vec< T > &x)
Exchange the contents of the object with that of x.
void unchecked_erase_by_index(const BCP_vec< int > &positions)
Same as the previous method but without the sanity check.
void fint fint fint real fint real * x
void destroy(iterator pos)