CppAD: A C++ Algorithmic Differentiation Package
20171217
|
The CppAD Simple Vector template class. More...
Public Types | |
typedef Type | value_type |
type of the elements in the vector More... | |
Public Member Functions | |
size_t | capacity (void) const |
maximum number of elements current allocation can store More... | |
void | clear (void) |
free memory and set number of elements to zero More... | |
Type * | data (void) |
raw pointer to the data More... | |
const Type * | data (void) const |
const raw pointer to the data More... | |
vector & | operator= (const vector &x) |
vector assignment operator More... | |
vector & | operator= (vector &&x) |
vector assignment operator with move semantics 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... | |
void | push_back (const Type &s) |
add an element to the back of this vector More... | |
template<class Vector > | |
void | push_vector (const Vector &v) |
add vector to the back of this vector (we could not use push_back because MS V++ 7.1 did not resolve to non-template member function when scalar is used.) More... | |
void | resize (size_t n) |
change the number of elements in this vector. More... | |
size_t | size (void) const |
number of elements currently in this vector. More... | |
vector (void) | |
default constructor sets capacity_ = length_ = data_ = 0 More... | |
vector (size_t n) | |
sizing constructor More... | |
vector (const vector &x) | |
copy constructor More... | |
~vector (void) | |
destructor More... | |
Private Member Functions | |
void | delete_data (Type *data_ptr) |
delete data pointer 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 Type elements currently in this vector More... | |
The CppAD Simple Vector template class.
Definition at line 338 of file vector.hpp.