template <class T> class Vector

one dimensional dynamic array

Inheritance:

Vector


public members:

inline Vector()
inline virtual ~Vector()
inline Vector(const Vector <T>& invec)
inline Vector(const std::vector<T>& invec)
inline Vector <T>& operator=(const std::vector<T>& invec)
inline Vector <T>& operator=(const Vector <T>& invec)
inline Vector( unsigned int isize)
inline void clear()
inline size_t size() const
inline Vector( unsigned int isize, const T& value)
inline T& operator[] ( unsigned int n)
inline const T& operator[] ( unsigned int n) const
inline void push_back(const T& in)
inline void append(const Vector <T>& invec)
inline void resize( unsigned int isize)
inline void resize( unsigned int isize, const T& value)
inline void sort()

Documentation

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.

inline Vector ()
Default constructor. Creates a Vector of zero length with null data.

inline virtual ~Vector ()
Destructor.

inline Vector (const Vector <T>& invec)
Copy constructor.

inline Vector (const std::vector<T>& invec)
conversion constructor

inline Vector <T>& operator= (const std::vector<T>& invec)

inline Vector <T>& operator= (const Vector <T>& invec)

inline Vector ( unsigned int isize)
Constructs a Vector with given number of elements.

Arguments:
size (not modified): number of elements of Vector to construct.
This:
-------The object is modified----------

inline void clear ()

inline size_t size () const
size function. returns current size of Vector

inline Vector ( unsigned int isize, const T& value)
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----------

inline T& operator[] ( unsigned int n)
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 -----

inline const T& operator[] ( unsigned int n) const
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.

inline void push_back (const T& in)

inline void append (const Vector <T>& invec)
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----------

inline void resize ( unsigned int isize)

inline void resize ( unsigned int isize, const T& value)

inline void sort ()


this class has no child classes.

alphabetic index hierarchy of classes


Chombo

Copyright Notice

This software is copyright (C) by the Lawrence Berkeley National Laboratory. Permission is granted to reproduce this software for non-commercial purposes provided that this notice is left intact.

It is acknowledged that the U.S. Government has rights to this software under Contract DE-AC03-765F00098 between the U.S. Department of Energy and the University of California.

This software is provided as a professional and academic contribution for joint exchange. Thus it is experimental, is provided ``as is'', with no warranties of any kind whatsoever, no support, no promise of updates, or printed documentation. By using this software, you acknowledge that the Lawrence Berkeley National Laboratory and Regents of the University of California shall have no liability with respect to the infringement of other copyrights by any part of this software.