#include <Vector.H>
Inheritance diagram for Vector< T >:
Public Member Functions | |
Vector () | |
virtual | ~Vector () |
Vector (const Vector< T > &invec) | |
Vector (const std::vector< T > &invec) | |
Vector< T > & | operator= (const std::vector< T > &invec) |
Vector< T > & | operator= (const Vector< T > &invec) |
Vector< T > & | assign (const T &inval) |
assign a scalar to every element of the vector | |
Vector (unsigned int isize) | |
void | clear () |
size_t | size () const |
Vector (unsigned int isize, const T &value) | |
T & | operator[] (unsigned int n) |
const T & | operator[] (unsigned int n) const |
void | swap (Vector< T > &other) |
void | push_back (const T &in) |
void | append (const Vector< T > &invec) |
void | resize (unsigned int isize) |
void | reserve (size_t isize) |
size_t | capacity () const |
void | resize (unsigned int isize, const T &value) |
void | sort () |
Vector is a resizable one-dimensional array with constant-time random access and range checking. The template type T must have a default constructor, a copy constructor, and an assignment operator.
Vector<T> is publically derived from std::vector<T>. Read the friendly STL manual.
|
Default constructor. Creates a Vector of zero length with null data. |
|
Destructor. |
|
Copy constructor. |
|
conversion constructor |
|
Constructs a Vector with given number of elements.\ { Arguments:} \ size (not modified): number of elements of Vector to construct.\ { This:} \ -------The object is modified---------- |
|
Constructs a Vector with given number of elements and constant value.\ { Arguments:} \ size (not modified): number of elements of Vector to construct.\ value (not modified): value to set every element to.\ { This:} \ -------The object is modified---------- |
|
Modifies this Vector by appending the elements of the argument Vector. The new Vector will have a size of this->size() + invec.size() (where this Vector is considered before the append is performed). The first element of invec will have index this->size(), the second element will have index this->size()+1, etc.\ { Arguments:} \ invec (not modified): Vector whose elements to append to this Vector.\ { This:} \ -------The object is modified---------- |
|
assign a scalar to every element of the vector [NOTE: cant use operator=() for this because it would be ambiguous with the (int) constructor for number T types.] |
|
|
|
|
|
|
|
|
|
Returns a constant reference to the given element in this Vector.\ { Arguments: } \ n (not modified) index of desired element.\ { Returns:} \ constant reference to value in Vector at index n.\ { This:} \ This object is not modified. |
|
Returns a modifiable lvalue reference to the value of the given element in this Vector. It is an error if n < 0 or n >= this->size(). \ { Arguments: } \ n (not modified) index of desired element.\ { Returns:} \ modifiable reference to value in Vector at index n.\ { This:} \ ----- This object is modified if the returned reference is assigned a new value ----- |
|
|
|
|
|
|
|
|
|
size function. returns current size of Vector |
|
|
|
|