Chombo + EB  3.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Vector< T > Class Template Reference

one dimensional dynamic array More...

#include <Vector.H>

Inherited by ParticleVector< T, Comparator >.

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 More...
 
 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
 
T & front ()
 
T & back ()
 
void pop_back ()
 
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. More...
 
const std::vector< T > & constStdVector () const
 

Private Member Functions

unsigned int initFunc ()
 

Private Attributes

std::vector< T > v
 

Detailed Description

template<class T>
class Vector< T >

one dimensional dynamic array

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.

Constructor & Destructor Documentation

template<class T>
Vector< T >::Vector ( )
inline

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

template<class T>
virtual Vector< T >::~Vector ( )
inlinevirtual

Destructor.

Referenced by GraphNode::clear().

template<class T>
Vector< T >::Vector ( const Vector< T > &  invec)
inline

Copy constructor.

template<class T>
Vector< T >::Vector ( const std::vector< T > &  invec)
inline

conversion constructor

template<class T>
Vector< T >::Vector ( unsigned int  isize)
inline

Constructs a Vector with given number of elements.\

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

template<class T>
Vector< T >::Vector ( unsigned int  isize,
const T &  value 
)
inline

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-------—

Member Function Documentation

template<class T>
Vector<T>& Vector< T >::operator= ( const std::vector< T > &  invec)
inline
template<class T>
Vector<T>& Vector< T >::operator= ( const Vector< T > &  invec)
inline
template<class T>
Vector<T>& Vector< T >::assign ( const T &  inval)
inline
template<class T>
void Vector< T >::clear ( )
inline
template<class T>
size_t Vector< T >::size ( ) const
inline

size function. returns current size of Vector

Referenced by IFidTable::add(), IFid::aggregate(), BoxLayoutData< T >::allocateGhostVector(), AMRTGA< T >::AMRTGA(), IFid::append(), Vector< LevelTGAHelmOp< LevelData< EBCellFAB >, EBFluxFAB > * >::append(), AggStencil< srcData_t, dstData_t >::apply(), Vector< LevelTGAHelmOp< LevelData< EBCellFAB >, EBFluxFAB > * >::assign(), BaseLevelHeatSolver< LevelData< FArrayBox >, FluxBox, LevelFluxRegister >::BaseLevelHeatSolver(), blockWrite(), blockWriteBufferToFile(), Vector< LevelTGAHelmOp< LevelData< EBCellFAB >, EBFluxFAB > * >::clear(), BoxLayoutData< T >::clear(), ComputeCutCellMoments< dim >::computeRhs(), AMRTGA< T >::createData(), dataSize(), BaseEBFaceFAB< Real >::dataType(), MultilevelLinearOp< T >::define(), TreeIntVectSetIterator::define(), MultilevelLinearOp< T >::dotProduct(), ShiftIterator::end(), LSProblem< dim >::fillMap(), gatherBoxesAndOffsets(), ParmParse::getarr(), getOffsets(), BaseIVFAB< T >::linearIn(), MiniIFFAB< T >::linearIn(), BaseIFFAB< T >::linearIn(), linearListOut(), linearListSize(), BaseIVFAB< T >::linearOut(), MiniIFFAB< T >::linearOut(), BaseIFFAB< T >::linearOut(), BaseEBFaceFAB< Real >::offset(), TagSet::ok(), ShiftIterator::ok(), CopyIterator::ok(), Vector< LevelTGAHelmOp< LevelData< EBCellFAB >, EBFluxFAB > * >::operator=(), IFid::operator==(), IFidTable::operator[](), Vector< LevelTGAHelmOp< LevelData< EBCellFAB >, EBFluxFAB > * >::operator[](), ParmParse::queryarr(), read(), regionGather(), AMRMultiGrid< T >::relaxOnlyHomogeneous(), AMRTGA< T >::resetAlphaAndBeta(), BaseLevelHeatSolver< LevelData< FArrayBox >, FluxBox, LevelFluxRegister >::resetSolverAlphaAndBeta(), Vector< LevelTGAHelmOp< LevelData< EBCellFAB >, EBFluxFAB > * >::resize(), VarCoefStencil::setAllVariables(), VoFStencil::setAllVariables(), FaceStencil::setAllVariables(), BaseEBFaceFAB< T >::setCoveredFaceVal(), IFData< dim >::setNormalDerivatives(), AMRTGA< T >::setTime(), VarCoefStencil::size(), VoFIterator::size(), IFidTable::size(), VoFStencil::size(), BaseIVFAB< T >::size(), MiniIFFAB< T >::size(), BaseIFFAB< T >::size(), BaseLevelHeatSolver< LevelData< FArrayBox >, FluxBox, LevelFluxRegister >::size(), BaseLevelHeatSolver< LevelData< FArrayBox >, FluxBox, LevelFluxRegister >::solveHelm(), AMRMultiGrid< T >::solveNoInit(), AMRMultiGrid< T >::solveNoInitResid(), BaseLevelCrankNicolson< LevelData< EBCellFAB >, EBFluxFAB, EBFluxRegister >::updateSoln(), BaseLevelBackwardEuler< LevelData< FArrayBox >, FluxBox, LevelFluxRegister >::updateSoln(), BaseLevelTGA< LevelData< FArrayBox >, FluxBox, LevelFluxRegister >::updateSolnWithTimeDependentOp(), BaseLevelTGA< LevelData< FArrayBox >, FluxBox, LevelFluxRegister >::updateSolnWithTimeIndependentOp(), Vector< LevelTGAHelmOp< LevelData< EBCellFAB >, EBFluxFAB > * >::Vector(), write(), Vector< LevelTGAHelmOp< LevelData< EBCellFAB >, EBFluxFAB > * >::~Vector(), and ViscousTensorOpFactory::~ViscousTensorOpFactory().

template<class T>
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

template<class T>
const T& Vector< T >::operator[] ( unsigned int  n) const
inline

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.

template<class T>
T& Vector< T >::front ( )
inline
template<class T>
T& Vector< T >::back ( )
inline
template<class T>
void Vector< T >::pop_back ( )
inline
template<class T>
const T& Vector< T >::back ( ) const
inline
template<class T>
void Vector< T >::swap ( Vector< T > &  other)
inline
template<class T>
void Vector< T >::push_back ( const T &  in)
inline
template<class T>
void Vector< T >::append ( const Vector< T > &  invec)
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().

template<class T>
void Vector< T >::resize ( unsigned int  isize)
inline
template<class T>
void Vector< T >::reserve ( size_t  isize)
inline
template<class T>
size_t Vector< T >::capacity ( ) const
inline
template<class T>
void Vector< T >::resize ( unsigned int  isize,
const T &  value 
)
inline
template<class T>
void Vector< T >::sort ( )
inline
template<class T>
std::vector<T>& Vector< T >::stdVector ( )
inline

Returns std::vector under the hood.

Referenced by IFidTable::add().

template<class T>
const std::vector<T>& Vector< T >::constStdVector ( ) const
inline
template<class T>
unsigned int Vector< T >::initFunc ( )
private

Member Data Documentation

template<class T>
std::vector<T> Vector< T >::v
private

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