CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CppAD::local::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...

Public Member Functions

size_t capacity (void) const
 current capacity (amount of allocated storage) for this vector. More...
 
void clear (void)
 Remove all the elements from this vector and free its memory. More...
 
Type * data (void)
 current data pointer is no longer valid after any of the following: extend, erase, operator=, and ~pod_vector. Take extreem care when using this function. More...
 
const Type * data (void) const
 const version of data pointer (see non-const documentation) More...
 
void erase (void)
 Remove all the elements from this vector but leave the capacity and data pointer as is. More...
 
size_t extend (size_t n)
 Increase the number of elements the end of this vector (existing elements are always preserved). More...
 
void operator= (const pod_vector &x)
 vector assignment operator More...
 
Type & operator[] (size_t i)
 non-constant element access; i.e., we can change this element value More...
 
const Type & operator[] (size_t i) const
 constant element access; i.e., we cannot change this element value More...
 
 pod_vector (void)
 default constructor sets capacity_ = length_ = data_ = 0 More...
 
 pod_vector (size_t n)
 sizing constructor More...
 
void push_back (const Type &e)
 Add an element to theh back of this vector. More...
 
void resize (size_t n)
 resize the vector (existing elements preserved when n <= capacity_). More...
 
size_t size (void) const
 current number of elements in this vector. More...
 
void swap (pod_vector &other)
 Swap all properties of this vector with another. More...
 
 ~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. More...
 

Private Member Functions

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

Private Attributes

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

Detailed Description

template<class Type>
class CppAD::local::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 34 of file pod_vector.hpp.


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