APFEL 4.8.0
A PDF evolution library in C++
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
apfel::ExtendedVector< T > Class Template Reference

Class that extends vectors to negative indices. More...

#include <extendedvector.h>

Public Member Functions

 ExtendedVector (int const &size=0, T const &value=0, int const &imin=0)
 The ExtendedVector constructor.
 
T & operator[] (int const &index)
 Returns the value at the possibly negative given index.
 
const T & operator[] (int const &index) const
 Returns the value at the possibly negative given index.
 
int min () const
 Returns the lower bound.
 
int max () const
 Returns the upper bound.
 
size_t size () const
 Returns the size of the vector.
 
void resize (int const &size, T const &value=0, int const &imin=0)
 Resizes the continer.
 
std::vector< T >::iterator begin ()
 Non-constant begin iterator.
 
std::vector< T >::const_iterator begin () const
 Constant begin iterator.
 
std::vector< T >::iterator end ()
 Non-constant end iterator.
 
std::vector< T >::const_iterator end () const
 Constant end iterator.
 

Private Attributes

int _imin
 The lower bound.
 
std::vector< T > _vector
 The container.
 

Detailed Description

template<class T>
class apfel::ExtendedVector< T >

Class that extends vectors to negative indices.

Constructor & Destructor Documentation

◆ ExtendedVector()

template<class T >
apfel::ExtendedVector< T >::ExtendedVector ( int const & size = 0,
T const & value = 0,
int const & imin = 0 )
inline

The ExtendedVector constructor.

Parameters
sizethe size of the container (default: 0)
valueinitialisation value (default: 0)
iminthe lowest allowed index (default: 0)

Member Function Documentation

◆ begin() [1/2]

template<class T >
std::vector< T >::iterator apfel::ExtendedVector< T >::begin ( )
inline

Non-constant begin iterator.

◆ begin() [2/2]

template<class T >
std::vector< T >::const_iterator apfel::ExtendedVector< T >::begin ( ) const
inline

Constant begin iterator.

◆ end() [1/2]

template<class T >
std::vector< T >::iterator apfel::ExtendedVector< T >::end ( )
inline

Non-constant end iterator.

◆ end() [2/2]

template<class T >
std::vector< T >::const_iterator apfel::ExtendedVector< T >::end ( ) const
inline

Constant end iterator.

◆ max()

template<class T >
int apfel::ExtendedVector< T >::max ( ) const
inline

Returns the upper bound.

Returns
the upper bound

◆ min()

template<class T >
int apfel::ExtendedVector< T >::min ( ) const
inline

Returns the lower bound.

Returns
the lower bound

◆ operator[]() [1/2]

template<class T >
T & apfel::ExtendedVector< T >::operator[] ( int const & index)
inline

Returns the value at the possibly negative given index.

Parameters
indexthe position index
Returns
the value at the possibly negative given index
Note
Settable version

◆ operator[]() [2/2]

template<class T >
const T & apfel::ExtendedVector< T >::operator[] ( int const & index) const
inline

Returns the value at the possibly negative given index.

Parameters
indexthe position index
Returns
the value at the possibly negative given index
Note
Non-settable version

◆ resize()

template<class T >
void apfel::ExtendedVector< T >::resize ( int const & size,
T const & value = 0,
int const & imin = 0 )
inline

Resizes the continer.

Parameters
sizethe new size
valuethe value used to fill in the additional (if any) slots
iminthe lowest allowed index (default: 0)

◆ size()

template<class T >
size_t apfel::ExtendedVector< T >::size ( ) const
inline

Returns the size of the vector.

Member Data Documentation

◆ _imin

template<class T >
int apfel::ExtendedVector< T >::_imin
private

The lower bound.

◆ _vector

template<class T >
std::vector<T> apfel::ExtendedVector< T >::_vector
private

The container.


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