CppAD: A C++ Algorithmic Differentiation Package  20130918
CppAD::pod_vector< Type > Class Template Reference

A vector class with Type element that does not use element constructors or destructors when Type is Plain Old Data (pod). More...

List of all members.

Public Member Functions

size_t capacity (void) const
 current capacity (amount of allocated storage) for this vector.
Type * data (void)
 current data pointer, no longer valid after any of the following: extend, erase, operator=, and ~pod_vector. Take extreem care when using this function.
const Type * data (void) const
 const version of data pointer
void erase (void)
 Remove all the elements from this vector but leave the capacity and data pointer as is.
size_t extend (size_t n)
 Increase the number of elements the end of this vector.
void free (void)
 Remove all the elements from this vector and delete its memory.
void operator= (const pod_vector &x)
 vector assignment operator If the resulting length of the vector would be more than max_length_, and NDEBUG is not defined, a CPPAD_ASSERT is generated.
Type & operator[] (size_t i)
 non-constant element access; i.e., we can change this element value
const Type & operator[] (size_t i) const
 constant element access; i.e., we cannot change this element value
 pod_vector (size_t max_length=std::numeric_limits< size_t >::max())
 Constructors set capacity, length, and data to zero.
size_t size (void) const
 current number of elements in this vector.
void swap (pod_vector &other)
 Swap all properties of this vector with another.
 ~pod_vector (void)
 Destructor: returns allocated memory to thread_alloc; see extend. If this is not plain old data, the destructor for each element is called.

Private Member Functions

 pod_vector (const pod_vector &)
 do not use the copy constructor

Private Attributes

size_t capacity_
 maximum number of Type elements current allocation can hold
Type * data_
 pointer to the first type elements (not defined and should not be used when capacity_ = 0)
size_t length_
 number of elements currently in this vector
size_t max_length_
 maximum number of elements that should ever be in this vector

Detailed Description

template<class Type>
class CppAD::pod_vector< Type >

A vector class with Type element that does not use element constructors or destructors when Type is Plain Old Data (pod).

Definition at line 52 of file pod_vector.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines