coin-Bcp
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
BCP_vec< T > Class Template Reference

The class BCP_vec serves the same purpose as the vector class in the standard template library. More...

#include <BCP_vector.hpp>

Collaboration diagram for BCP_vec< T >:
Collaboration graph
[legend]

Public Types

Type definitions (needed for using the STL)
typedef size_t size_type
 
typedef T value_type
 
typedef T * iterator
 
typedef const T * const_iterator
 
typedef T & reference
 
typedef const T & const_reference
 

Public Member Functions

template<>
 BCP_vec (const size_t n, const_reference value)
 
template<>
 BCP_vec (const_iterator first, const_iterator last)
 
template<>
 BCP_vec (const bool *x, const size_t num)
 
template<>
void reserve (const size_t n)
 
template<>
BCP_vec< bool > & operator= (const BCP_vec< bool > &x)
 
template<>
void assign (const void *x, const size_t num)
 
template<>
void insert (bool *position, const void *first, const size_t n)
 
template<>
void insert (iterator position, const_iterator first, const_iterator last)
 
template<>
void insert (iterator position, const size_t n, const_reference x)
 
template<>
BCP_vec< bool >::iterator insert (iterator position, const_reference x)
 
template<>
void push_back (const_reference x)
 
template<>
void unchecked_push_back (const_reference x)
 
template<>
void pop_back ()
 
template<>
void unchecked_update (const BCP_vec< int > &positions, const BCP_vec< bool > &values)
 
template<>
void update (const BCP_vec< int > &positions, const BCP_vec< bool > &values)
 
template<>
void keep (iterator pos)
 
template<>
void keep (iterator first, iterator last)
 
template<>
void erase (iterator position)
 
template<>
void erase (iterator first, iterator last)
 
template<>
 BCP_vec (const size_t n, const_reference value)
 
template<>
 BCP_vec (const_iterator first, const_iterator last)
 
template<>
 BCP_vec (const short *x, const size_t num)
 
template<>
void reserve (const size_t n)
 
template<>
BCP_vec< short > & operator= (const BCP_vec< short > &x)
 
template<>
void assign (const void *x, const size_t num)
 
template<>
void insert (short *position, const void *first, const size_t n)
 
template<>
void insert (iterator position, const_iterator first, const_iterator last)
 
template<>
void insert (iterator position, const size_t n, const_reference x)
 
template<>
BCP_vec< short >::iterator insert (iterator position, const_reference x)
 
template<>
void push_back (const_reference x)
 
template<>
void unchecked_push_back (const_reference x)
 
template<>
void pop_back ()
 
template<>
void unchecked_update (const BCP_vec< int > &positions, const BCP_vec< short > &values)
 
template<>
void update (const BCP_vec< int > &positions, const BCP_vec< short > &values)
 
template<>
void keep (iterator pos)
 
template<>
void keep (iterator first, iterator last)
 
template<>
void erase (iterator position)
 
template<>
void erase (iterator first, iterator last)
 
Constructors / Destructor
 BCP_vec ()
 The default constructor initializes the data members as 0 pointers. More...
 
 BCP_vec (const BCP_vec< T > &x)
 The copy constructor copies over the content of x. More...
 
 BCP_vec (const size_t n, const_reference value=T())
 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 T *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...
 
Query methods
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...
 
General modifying methods
void reserve (const size_t n)
 Reallocate the object to make space for n entries. More...
 
void swap (BCP_vec< T > &x)
 Exchange the contents of the object with that of x. More...
 
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. 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< T > &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< T > &values)
 Update those entries listed in positions to the given values. More...
 
void unchecked_update (const BCP_vec< int > &positions, const BCP_vec< T > &values)
 Same as the previous method but without sanity checks. More...
 
Methods for selectively keeping entries
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 unchecked_keep_by_index (const BCP_vec< int > &positions)
 Same as the previous method but without the sanity checks. 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 int *firstpos, const int *lastpos)
 Same as the previous method but without the sanity checks. More...
 
Methods for selectively erasing entries
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 unchecked_erase_by_index (const BCP_vec< int > &positions)
 Same as the previous method but without the sanity check. 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 int *firstpos, const int *lastpos)
 Same as the previous method but without the sanity checks. More...
 

Protected Member Functions

template<>
void deallocate ()
 
template<>
void insert_aux (iterator position, const_reference x)
 
template<>
void deallocate ()
 
template<>
void insert_aux (iterator position, const_reference x)
 
Internal methods
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...
 

Protected Attributes

Data members
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...
 

Private Member Functions

void destroy (iterator pos)
 
void destroy_range (iterator first, iterator last)
 
void construct (iterator pos)
 
void construct (iterator pos, const_reference x)
 
template<>
void destroy (iterator pos)
 
template<>
void destroy_range (iterator first, iterator last)
 
template<>
void construct (iterator pos)
 
template<>
void construct (iterator pos, const_reference x)
 
template<>
void destroy (iterator pos)
 
template<>
void destroy_range (iterator first, iterator last)
 
template<>
void construct (iterator pos)
 
template<>
void construct (iterator pos, const_reference x)
 

Detailed Description

template<class T>
class BCP_vec< T >

The class BCP_vec serves the same purpose as the vector class in the standard template library.

The main difference is that while the vector class is likely to be implemented as a memory array, BCP_vec is implemented that way. Also, BCP_vec has a number of extra member methods, most of them exist to speed up operations (e.g., there are unchecked versions of the insert member methods, i.e., the method does not check whether there is enough space allocated to fit the new elements).

Definition at line 24 of file BCP_vector.hpp.

Member Typedef Documentation

template<class T>
typedef size_t BCP_vec< T >::size_type

Definition at line 29 of file BCP_vector.hpp.

template<class T>
typedef T BCP_vec< T >::value_type

Definition at line 31 of file BCP_vector.hpp.

template<class T>
typedef T* BCP_vec< T >::iterator

Definition at line 33 of file BCP_vector.hpp.

template<class T>
typedef const T* BCP_vec< T >::const_iterator

Definition at line 35 of file BCP_vector.hpp.

template<class T>
typedef T& BCP_vec< T >::reference

Definition at line 37 of file BCP_vector.hpp.

template<class T>
typedef const T& BCP_vec< T >::const_reference

Definition at line 39 of file BCP_vector.hpp.

Constructor & Destructor Documentation

template<class T >
BCP_vec< T >::BCP_vec ( )

The default constructor initializes the data members as 0 pointers.

Definition at line 65 of file BCP_vector_general.hpp.

template<class T>
BCP_vec< T >::BCP_vec ( const BCP_vec< T > &  x)

The copy constructor copies over the content of x.

Definition at line 68 of file BCP_vector_general.hpp.

template<class T>
BCP_vec< T >::BCP_vec ( const size_t  n,
const_reference  value = T() 
)

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).

Definition at line 75 of file BCP_vector_general.hpp.

References BCP_vec< T >::allocate(), BCP_vec< T >::end_of_storage, BCP_vec< T >::finish, and BCP_vec< T >::start.

template<class T>
BCP_vec< T >::BCP_vec ( const_iterator  first,
const_iterator  last 
)

Construct a BCP_vec by copying the elements from first to last-1.

Definition at line 86 of file BCP_vector_general.hpp.

References BCP_vec< T >::allocate(), BCP_vec< T >::end_of_storage, BCP_vec< T >::finish, and BCP_vec< T >::start.

template<class T>
BCP_vec< T >::BCP_vec ( const T *  x,
const size_t  num 
)

Construct a BCP_vec by copying num objects of type T from the memory starting at x.

Definition at line 97 of file BCP_vector_general.hpp.

References BCP_vec< T >::allocate(), BCP_vec< T >::construct(), BCP_vec< T >::end_of_storage, BCP_vec< T >::finish, and BCP_vec< T >::start.

template<class T>
virtual BCP_vec< T >::~BCP_vec ( )
inlinevirtual

The destructor deallocates the memory allocated for the BCP_vec.

Definition at line 93 of file BCP_vector.hpp.

template<>
BCP_vec< bool >::BCP_vec ( const size_t  n,
const_reference  value 
)
template<>
BCP_vec< bool >::BCP_vec ( const_iterator  first,
const_iterator  last 
)
template<>
BCP_vec< bool >::BCP_vec ( const bool *  x,
const size_t  num 
)
template<>
BCP_vec< short >::BCP_vec ( const size_t  n,
const_reference  value 
)
template<>
BCP_vec< short >::BCP_vec ( const_iterator  first,
const_iterator  last 
)
template<>
BCP_vec< short >::BCP_vec ( const short *  x,
const size_t  num 
)

Member Function Documentation

template<class T >
void BCP_vec< T >::destroy ( iterator  pos)
inlineprivate

Definition at line 6 of file BCP_vector_general.hpp.

template<class T >
void BCP_vec< T >::destroy_range ( iterator  first,
iterator  last 
)
inlineprivate

Definition at line 11 of file BCP_vector_general.hpp.

template<class T >
void BCP_vec< T >::construct ( iterator  pos)
inlineprivate

Definition at line 18 of file BCP_vector_general.hpp.

Referenced by BCP_vec< T >::BCP_vec().

template<class T >
void BCP_vec< T >::construct ( iterator  pos,
const_reference  x 
)
inlineprivate

Definition at line 23 of file BCP_vector_general.hpp.

template<class T >
BCP_vec< T >::iterator BCP_vec< T >::allocate ( size_t  len)
inlineprotected

allocate raw, uninitialized memory for len entries.

Definition at line 30 of file BCP_vector_general.hpp.

Referenced by BCP_vec< T >::BCP_vec().

template<class T >
void BCP_vec< T >::deallocate ( )
inlineprotected

Destroy the entries in the vector and free the memory allocated for the vector.

Definition at line 35 of file BCP_vector_general.hpp.

Referenced by BCP_vec< BCP_lp_result * >::~BCP_vec().

template<class T >
void BCP_vec< T >::insert_aux ( iterator  position,
const_reference  x 
)
protected

insert x into the given position in the vector.

Reallocate the vector if necessary.

Definition at line 43 of file BCP_vector_general.hpp.

Referenced by BCP_vec< char >::insert(), BCP_vec< int >::insert(), BCP_vec< double >::insert(), BCP_vec< double >::push_back(), BCP_vec< char >::push_back(), and BCP_vec< int >::push_back().

template<class T>
iterator BCP_vec< T >::begin ( )
inline
template<class T>
const_iterator BCP_vec< T >::begin ( ) const
inline

Return a const iterator to the beginning of the object.

Definition at line 101 of file BCP_vector.hpp.

template<class T>
iterator BCP_vec< T >::end ( )
inline
template<class T>
const_iterator BCP_vec< T >::end ( ) const
inline

Return a const iterator to the end of the object.

Definition at line 106 of file BCP_vector.hpp.

template<class T>
iterator BCP_vec< T >::entry ( const int  i)
inline
template<class T>
const_iterator BCP_vec< T >::entry ( const int  i) const
inline

Return a const iterator to the i-th entry.

Definition at line 111 of file BCP_vector.hpp.

template<class T>
size_t BCP_vec< T >::index ( const_iterator  pos) const
inline

Return the index of the entry pointed to by pos.

Definition at line 114 of file BCP_vector.hpp.

template<class T>
size_t BCP_vec< T >::size ( ) const
inline

Return the current number of entries.

Definition at line 116 of file BCP_vector.hpp.

Referenced by BCP_obj_set_change::added_num(), BCP_internal_brobj::affected_cutnum(), BCP_internal_brobj::affected_varnum(), BCP_lp_branching_object::BCP_lp_branching_object(), BCP_vec_change< char >::BCP_vec_change(), BCP_obj_set_change::changed_num(), BCP_tm_node::child_num(), BCP_lp_relax::colnum(), BCP_internal_brobj::cut_bounds_child(), BCP_problem_core::cutnum(), BCP_lp_node::cutnum(), BCP_problem_core_change::cutnum(), BCP_lp_branching_object::cuts_added(), BCP_lp_branching_object::cuts_affected(), BCP_lp_branching_object::forced_cut_bd_child(), BCP_lp_branching_object::forced_var_bd_child(), BCP_presolved_lp_brobj::get_lower_bounds(), BCP_lp_branching_object::implied_cut_bd_child(), BCP_lp_branching_object::implied_var_bd_child(), BCP_tree::insert(), BCP_presolved_lp_brobj::is_pruned(), BCP_presolved_lp_brobj::keep_no_child(), keep_ptr_vector_by_index(), BCP_vec< T >::operator=(), operator==(), BCP_buffer::pack(), BCP_parameter_set< BCP_tm_par >::pack(), BCP_lp_relax::rownum(), BCP_presolved_lp_brobj::set_lower_bounds(), BCP_tree::size(), BCP_vec_change< char >::storage_size(), BCP_vec< T >::unchecked_update(), BCP_vec< char >::unchecked_update(), BCP_vec< int >::unchecked_update(), BCP_vec< double >::unchecked_update(), BCP_vec< T >::update(), BCP_vec_change< char >::update(), BCP_vec< char >::update(), BCP_vec< int >::update(), BCP_vec< double >::update(), BCP_internal_brobj::var_bounds_child(), BCP_problem_core::varnum(), BCP_lp_node::varnum(), BCP_problem_core_change::varnum(), BCP_lp_branching_object::vars_added(), BCP_lp_branching_object::vars_affected(), BCP_parameter_set< BCP_tm_par >::write_to_stream(), BCP_presolved_lp_brobj::~BCP_presolved_lp_brobj(), and BCP_tree::~BCP_tree().

template<class T>
size_t BCP_vec< T >::capacity ( ) const
inline

Return the capacity of the object (space allocated for this many entries).

Definition at line 119 of file BCP_vector.hpp.

template<class T>
bool BCP_vec< T >::empty ( ) const
inline

Test if there are any entries in the object.

Definition at line 121 of file BCP_vector.hpp.

template<class T>
reference BCP_vec< T >::operator[] ( const size_t  i)
inline

Return a reference to the i-th entry.

Definition at line 124 of file BCP_vector.hpp.

Referenced by BCP_vec< char >::unchecked_update(), BCP_vec< int >::unchecked_update(), and BCP_vec< double >::unchecked_update().

template<class T>
const_reference BCP_vec< T >::operator[] ( const size_t  i) const
inline

Return a const reference to the i-th entry.

Definition at line 126 of file BCP_vector.hpp.

template<class T>
reference BCP_vec< T >::front ( )
inline

Return a reference to the first entry.

Definition at line 129 of file BCP_vector.hpp.

Referenced by BCP_tree::root().

template<class T>
const_reference BCP_vec< T >::front ( ) const
inline

Return a const reference to the first entry.

Definition at line 131 of file BCP_vector.hpp.

template<class T>
reference BCP_vec< T >::back ( )
inline

Return a reference to the last entry.

Definition at line 133 of file BCP_vector.hpp.

template<class T>
const_reference BCP_vec< T >::back ( ) const
inline

Return a const reference to the last entry.

Definition at line 135 of file BCP_vector.hpp.

template<class T >
void BCP_vec< T >::reserve ( const size_t  n)
template<class T>
void BCP_vec< T >::swap ( BCP_vec< T > &  x)
inline

Exchange the contents of the object with that of x.

Definition at line 124 of file BCP_vector_general.hpp.

References BCP_vec< T >::end_of_storage, BCP_vec< T >::finish, and BCP_vec< T >::start.

Referenced by BCP_problem_core::BCP_problem_core(), and BCP_presolved_lp_brobj::swap().

template<class T>
BCP_vec< T > & 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.

Definition at line 131 of file BCP_vector_general.hpp.

References BCP_vec< T >::begin(), BCP_vec< T >::end(), BCP_vec< T >::entry(), and BCP_vec< T >::size().

template<class T >
void BCP_vec< T >::assign ( const void *  x,
const size_t  num 
)

Copy num entries of type T starting at the memory location x into the object.

(x is a void pointer since it might be located somewhere in a buffer and therefore might not be aligned for type T entries.)

Definition at line 157 of file BCP_vector_general.hpp.

template<class T >
void BCP_vec< T >::insert ( iterator  position,
const void *  first,
const size_t  num 
)

Insert num entries starting from memory location first into the vector from position pos.

Definition at line 176 of file BCP_vector_general.hpp.

Referenced by BCP_vec< BCP_lp_result * >::append(), and BCP_buffer::unpack().

template<class T >
void BCP_vec< T >::insert ( iterator  position,
const_iterator  first,
const_iterator  last 
)

Insert the entries [first,last) into the vector from position pos.

Definition at line 225 of file BCP_vector_general.hpp.

template<class T >
void BCP_vec< T >::insert ( iterator  position,
const size_t  n,
const_reference  x 
)

Insert n copies of x into the vector from position pos.

Definition at line 256 of file BCP_vector_general.hpp.

template<class T >
BCP_vec< T >::iterator BCP_vec< T >::insert ( iterator  position,
const_reference  x 
)
inline

Insert x (a single entry) into the vector at position pos.

Return an iterator to the newly inserted entry.

Definition at line 287 of file BCP_vector_general.hpp.

template<class T>
void BCP_vec< T >::append ( const BCP_vec< T > &  x)
inline

Append the entries in x to the end of the vector.

Definition at line 169 of file BCP_vector.hpp.

Referenced by BCP_cut_set::append(), and BCP_var_set::append().

template<class T>
void BCP_vec< T >::append ( const_iterator  first,
const_iterator  last 
)
inline

Append the entries [first,last) to the end of the vector.

Definition at line 173 of file BCP_vector.hpp.

template<class T >
void BCP_vec< T >::push_back ( const_reference  x)
inline

Append x to the end of the vector.

Check if enough space is allocated (reallocate if necessary).

Definition at line 300 of file BCP_vector_general.hpp.

Referenced by BCP_solution_generic::add_entry(), BCP_presolved_lp_brobj::BCP_presolved_lp_brobj(), BCP_vec_change< char >::BCP_vec_change(), BCP_tree::insert(), BCP_tm_node::new_child(), and BCP_parameter_set< BCP_tm_par >::set_entry().

template<class T >
void BCP_vec< T >::unchecked_push_back ( const_reference  x)
inline

Append x to the end of the vector.

Does not check if enough space is allcoated.

Definition at line 308 of file BCP_vector_general.hpp.

Referenced by BCP_presolved_lp_brobj::BCP_presolved_lp_brobj(), BCP_presolved_lp_brobj::get_lower_bounds(), and BCP_parameter_set< BCP_tm_par >::unpack().

template<class T >
void BCP_vec< T >::pop_back ( )
inline

Delete the last entry.

Definition at line 313 of file BCP_vector_general.hpp.

template<class T >
void BCP_vec< T >::clear ( )
inline
template<class T>
void BCP_vec< T >::update ( const BCP_vec< int > &  positions,
const BCP_vec< T > &  values 
)
inline

Update those entries listed in positions to the given values.

The two argument vector must be of equal length. Sanity checks are done on the given positions.

Definition at line 336 of file BCP_vector_general.hpp.

References BCP_vec_sanity_check(), BCP_vec< T >::begin(), BCP_vec< T >::end(), and BCP_vec< T >::size().

template<class T>
void BCP_vec< T >::unchecked_update ( const BCP_vec< int > &  positions,
const BCP_vec< T > &  values 
)
inline

Same as the previous method but without sanity checks.

Definition at line 324 of file BCP_vector_general.hpp.

References BCP_vec< T >::begin(), BCP_vec< T >::end(), and BCP_vec< T >::size().

Referenced by BCP_vec< char >::update(), BCP_vec< int >::update(), and BCP_vec< double >::update().

template<class T >
void BCP_vec< T >::keep ( iterator  pos)
inline

Keep only the entry pointed to by pos.

Definition at line 347 of file BCP_vector_general.hpp.

template<class T >
void BCP_vec< T >::keep ( iterator  first,
iterator  last 
)
inline

Keep the entries [first,last).

Definition at line 354 of file BCP_vector_general.hpp.

template<class T >
void BCP_vec< T >::keep_by_index ( const BCP_vec< int > &  positions)
inline

Keep the entries indexed by indices.

Abort if the indices are not in increasing order, if there are duplicate indices or if any of the indices is outside of the range [0,size()).

Definition at line 362 of file BCP_vector_general.hpp.

References BCP_vec_sanity_check(), BCP_vec< T >::begin(), and BCP_vec< T >::end().

Referenced by keep_ptr_vector_by_index().

template<class T >
void BCP_vec< T >::unchecked_keep_by_index ( const BCP_vec< int > &  positions)
inline

Same as the previous method but without the sanity checks.

Definition at line 369 of file BCP_vector_general.hpp.

References BCP_vec< T >::begin(), and BCP_vec< T >::end().

template<class T>
void BCP_vec< T >::keep_by_index ( const int *  firstpos,
const int *  lastpos 
)
inline

Keep the entries indexed by the values in [firstpos,lastpos).

Abort if the indices are not in increasing order, if there are duplicate indices or if any of the indices is outside of the range [0,size()).

template<class T>
void BCP_vec< T >::unchecked_keep_by_index ( const int *  firstpos,
const int *  lastpos 
)

Same as the previous method but without the sanity checks.

template<class T >
void BCP_vec< T >::erase ( iterator  pos)
inline

Erase the entry pointed to by pos.

Definition at line 399 of file BCP_vector_general.hpp.

Referenced by purge_ptr_vector().

template<class T >
void BCP_vec< T >::erase ( iterator  first,
iterator  last 
)
inline

Erase the entries [first,last).

Definition at line 406 of file BCP_vector_general.hpp.

template<class T >
void BCP_vec< T >::erase_by_index ( const BCP_vec< int > &  positions)
inline

Erase the entries indexed by indices.

Abort if the indices are not in increasing order, if there are duplicate indices or if any of the indices is outside of the range [0,size()).

Definition at line 414 of file BCP_vector_general.hpp.

References BCP_vec_sanity_check(), BCP_vec< T >::begin(), and BCP_vec< T >::end().

Referenced by purge_ptr_vector_by_index().

template<class T >
void BCP_vec< T >::unchecked_erase_by_index ( const BCP_vec< int > &  positions)
inline

Same as the previous method but without the sanity check.

Definition at line 421 of file BCP_vector_general.hpp.

References BCP_vec< T >::begin(), and BCP_vec< T >::end().

template<class T>
void BCP_vec< T >::erase_by_index ( const int *  firstpos,
const int *  lastpos 
)
inline

Like the other erase_by_index method (including sanity checks), just the indices of the entries to be erased are given in [firstpos,lastpos).

template<class T>
void BCP_vec< T >::unchecked_erase_by_index ( const int *  firstpos,
const int *  lastpos 
)

Same as the previous method but without the sanity checks.

template<>
void BCP_vec< bool >::destroy ( iterator  pos)
inlineprivate

Definition at line 16 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::destroy_range ( iterator  first,
iterator  last 
)
inlineprivate

Definition at line 20 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::construct ( iterator  pos)
inlineprivate

Definition at line 24 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::construct ( iterator  pos,
const_reference  x 
)
inlineprivate

Definition at line 29 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::deallocate ( )
inlineprotected

Definition at line 38 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::insert_aux ( iterator  position,
const_reference  x 
)
protected
template<>
void BCP_vec< bool >::reserve ( const size_t  n)
template<>
BCP_vec< bool > & BCP_vec< bool >::operator= ( const BCP_vec< bool > &  x)
template<>
void BCP_vec< bool >::assign ( const void *  x,
const size_t  num 
)
template<>
void BCP_vec< bool >::insert ( bool *  position,
const void *  first,
const size_t  n 
)
template<>
void BCP_vec< bool >::insert ( iterator  position,
const_iterator  first,
const_iterator  last 
)
template<>
void BCP_vec< bool >::insert ( iterator  position,
const size_t  n,
const_reference  x 
)
template<>
BCP_vec< bool >::iterator BCP_vec< bool >::insert ( iterator  position,
const_reference  x 
)
inline

Definition at line 82 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::push_back ( const_reference  x)
inline

Definition at line 94 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::unchecked_push_back ( const_reference  x)
inline

Definition at line 102 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::pop_back ( )
inline

Definition at line 107 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::unchecked_update ( const BCP_vec< int > &  positions,
const BCP_vec< bool > &  values 
)
inline
template<>
void BCP_vec< bool >::update ( const BCP_vec< int > &  positions,
const BCP_vec< bool > &  values 
)
inline
template<>
void BCP_vec< bool >::keep ( iterator  pos)
inline

Definition at line 139 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::keep ( iterator  first,
iterator  last 
)
inline

Definition at line 145 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::erase ( iterator  position)
inline

Definition at line 168 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< bool >::erase ( iterator  first,
iterator  last 
)
inline

Definition at line 175 of file BCP_vector_bool.hpp.

template<>
void BCP_vec< short >::destroy ( iterator  pos)
inlineprivate

Definition at line 13 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::destroy_range ( iterator  first,
iterator  last 
)
inlineprivate

Definition at line 17 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::construct ( iterator  pos)
inlineprivate

Definition at line 21 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::construct ( iterator  pos,
const_reference  x 
)
inlineprivate

Definition at line 26 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::deallocate ( )
inlineprotected

Definition at line 35 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::insert_aux ( iterator  position,
const_reference  x 
)
protected
template<>
void BCP_vec< short >::reserve ( const size_t  n)
template<>
BCP_vec< short > & BCP_vec< short >::operator= ( const BCP_vec< short > &  x)
template<>
void BCP_vec< short >::assign ( const void *  x,
const size_t  num 
)
template<>
void BCP_vec< short >::insert ( short *  position,
const void *  first,
const size_t  n 
)
template<>
void BCP_vec< short >::insert ( iterator  position,
const_iterator  first,
const_iterator  last 
)
template<>
void BCP_vec< short >::insert ( iterator  position,
const size_t  n,
const_reference  x 
)
template<>
BCP_vec< short >::iterator BCP_vec< short >::insert ( iterator  position,
const_reference  x 
)
inline

Definition at line 79 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::push_back ( const_reference  x)
inline

Definition at line 91 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::unchecked_push_back ( const_reference  x)
inline

Definition at line 99 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::pop_back ( )
inline

Definition at line 104 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::unchecked_update ( const BCP_vec< int > &  positions,
const BCP_vec< short > &  values 
)
inline
template<>
void BCP_vec< short >::update ( const BCP_vec< int > &  positions,
const BCP_vec< short > &  values 
)
inline
template<>
void BCP_vec< short >::keep ( iterator  pos)
inline

Definition at line 135 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::keep ( iterator  first,
iterator  last 
)
inline

Definition at line 141 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::erase ( iterator  position)
inline

Definition at line 164 of file BCP_vector_short.hpp.

template<>
void BCP_vec< short >::erase ( iterator  first,
iterator  last 
)
inline

Definition at line 171 of file BCP_vector_short.hpp.

Member Data Documentation

template<class T>
iterator BCP_vec< T >::start
protected
template<class T>
iterator BCP_vec< T >::finish
protected
template<class T>
iterator BCP_vec< T >::end_of_storage
protected

The documentation for this class was generated from the following files: