#include <Vector.H>
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.
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 |
const T & | back () 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 () |
std::vector< T > & | stdVector () |
Returns std::vector under the hood. | |
const std::vector< T > & | constStdVector () const |
Private Member Functions | |
unsigned int | initFunc () |
Private Attributes | |
std::vector< T > | v |
Default constructor. Creates a Vector of zero length with null data.
conversion constructor
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.]
Referenced by MultilevelLinearOp< T >::assign(), BaseLevelTGA< T, TFlux, TFR >::computeDiffusion(), AMRTGA< T >::oneStep(), and BaseLevelTGA< T, TFlux, TFR >::updateSoln().
void Vector< T >::clear | ( | ) | [inline] |
size_t Vector< T >::size | ( | ) | const [inline] |
size function. returns current size of Vector
Referenced by LayoutData< T >::allocate(), BoxLayoutData< T >::allocateGhostVector(), AMRTGA< T >::AMRTGA(), Vector< IntVectSet * >::append(), Vector< IntVectSet * >::assign(), BaseLevelTGA< T, TFlux, TFR >::BaseLevelTGA(), Vector< IntVectSet * >::clear(), MultiGrid< T >::clear(), BoxLayoutData< T >::clear(), AMRMultiGrid< T >::clear(), AMRTGA< T >::createData(), TreeIntVectSetIterator::define(), MultilevelLinearOp< T >::define(), MiniIFFAB< T >::define(), MultilevelLinearOp< T >::dotProduct(), ShiftIterator::end(), AMRMultiGrid< T >::getAllOperators(), ParmParse::getarr(), MiniIFFAB< T >::getFaceSubset(), MiniIVFAB< T >::getIndex(), MiniIFFAB< T >::getIndex(), AMRMultiGrid< T >::getOperatorsMG(), AMRMultiGrid< T >::getOperatorsOp(), MiniIFFAB< T >::linearIn(), BaseIVFAB< T >::linearIn(), BaseIFFAB< T >::linearIn(), linearListOut(), linearListSize(), MiniIVFAB< T >::linearOut(), MiniIFFAB< T >::linearOut(), BaseIVFAB< T >::linearOut(), BaseIFFAB< T >::linearOut(), LSProblem< dim >::momentBounds(), ShiftIterator::ok(), TagSet::ok(), CopyIterator::ok(), Vector< IntVectSet * >::operator=(), Vector< IntVectSet * >::operator[](), MultilevelLinearOp< T >::preCond(), ParmParse::queryarr(), regionGather(), AMRMultiGrid< T >::relaxOnlyHomogeneous(), AMRTGA< T >::resetAlphaAndBeta(), BaseLevelTGA< T, TFlux, TFR >::resetSolverAlphaAndBeta(), MultilevelLinearOp< T >::residual(), Vector< IntVectSet * >::resize(), IFData< dim >::searchNormalDir(), VoFStencil::setAllVariables(), IFData< dim >::setChangingDirection(), BaseEBFaceFAB< T >::setCoveredFaceVal(), AMRMultiGrid< T >::setMGCycle(), AMRMultiGrid< T >::setSolverParameters(), VoFIterator::size(), MiniIVFAB< T >::size(), MiniIFFAB< T >::size(), BaseIVFAB< T >::size(), BaseIFFAB< T >::size(), BaseLevelTGA< T, TFlux, TFR >::solveHelm(), AMRMultiGrid< T >::solveNoInit(), BaseLevelTGA< T, TFlux, TFR >::updateSoln(), Vector< IntVectSet * >::Vector(), AMRTGA< T >::~AMRTGA(), and Vector< IntVectSet * >::~Vector().
T& Vector< T >::operator[] | ( | unsigned int | n | ) | [inline] |
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 -----
const T& Vector< T >::operator[] | ( | unsigned int | n | ) | const [inline] |
const T& Vector< T >::back | ( | ) | const [inline] |
void Vector< T >::push_back | ( | const T & | in | ) | [inline] |
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----------
Referenced by AMRMultiGrid< T >::getAllOperators().
void Vector< T >::resize | ( | unsigned int | isize | ) | [inline] |
Referenced by LayoutData< T >::allocate(), BoxLayoutData< T >::allocateGhostVector(), AMRTGA< T >::AMRTGA(), BaseLevelTGA< T, TFlux, TFR >::BaseLevelTGA(), MultiGrid< T >::clear(), MiniIVFAB< T >::clear(), MiniIFFAB< T >::clear(), AMRTGA< T >::createData(), TreeIntVectSetIterator::define(), MultilevelLinearOp< T >::define(), MultiGrid< T >::define(), AMRMultiGrid< T >::define(), gather(), ParmParse::getarr(), MiniIFFAB< T >::getFaceSubset(), LSProblem< dim >::invertNormalEq(), linearListIn(), ParmParse::queryarr(), regionGather(), MiniIVFAB< T >::setDefaultValues(), and Vector< IntVectSet * >::Vector().
void Vector< T >::reserve | ( | size_t | isize | ) | [inline] |
size_t Vector< T >::capacity | ( | ) | const [inline] |
void Vector< T >::resize | ( | unsigned int | isize, | |
const T & | value | |||
) | [inline] |
void Vector< T >::sort | ( | ) | [inline] |
std::vector<T>& Vector< T >::stdVector | ( | ) | [inline] |
Returns std::vector under the hood.
const std::vector<T>& Vector< T >::constStdVector | ( | ) | const [inline] |
unsigned int Vector< T >::initFunc | ( | ) | [private] |
Referenced by Vector< IntVectSet * >::append(), Vector< IntVectSet * >::assign(), Vector< IntVectSet * >::back(), Vector< IntVectSet * >::capacity(), Vector< IntVectSet * >::clear(), Vector< IntVectSet * >::constStdVector(), Vector< IntVectSet * >::operator=(), Vector< IntVectSet * >::operator[](), Vector< IntVectSet * >::push_back(), Vector< IntVectSet * >::reserve(), Vector< IntVectSet * >::resize(), Vector< IntVectSet * >::size(), Vector< IntVectSet * >::sort(), Vector< IntVectSet * >::stdVector(), and Vector< IntVectSet * >::swap().