ParM  parm
A molecular dynamics library
Public Member Functions | Protected Attributes | List of all members
Array< T, N > Class Template Reference

A fixed size array. More...

#include <vec.hpp>

Public Member Functions

 Array ()
 
 Array (const Array &rhs)
 
template<class U >
 Array (const Array< U, N > &rhs)
 
 Array (const T locs[N])
 
const T & get (const unsigned int n) const
 
void set (const unsigned int n, const T a)
 
unsigned int len () const
 
T & operator[] (const unsigned int i)
 
const T & operator[] (const unsigned int i) const
 
T * begin ()
 
T * end ()
 
 ~Array ()
 

Protected Attributes

vals [N]
 

Detailed Description

template<class T, unsigned int N>
class Array< T, N >

A fixed size array.

This is just a wrapper with some convenience methods, and the following is (roughly) equivalent:

Array<flt, 4> arr;
flt[4] arr;
Template Parameters
Ta type that can be added and subtracted.
Nthe number of dimensions.

Constructor & Destructor Documentation

template<class T , unsigned int N>
Array< T, N >::Array ( )
template<class T , unsigned int N>
Array< T, N >::Array ( const Array< T, N > &  rhs)
template<class T , unsigned int N>
template<class U >
Array< T, N >::Array ( const Array< U, N > &  rhs)
template<class T , unsigned int N>
Array< T, N >::Array ( const T  locs[N])
template<class T, unsigned int N>
Array< T, N >::~Array ( )
inline

Member Function Documentation

template<class T, unsigned int N>
T* Array< T, N >::begin ( )
inline
template<class T, unsigned int N>
T* Array< T, N >::end ( )
inline
template<class T, unsigned int N>
const T& Array< T, N >::get ( const unsigned int  n) const
inline
template<class T, unsigned int N>
unsigned int Array< T, N >::len ( ) const
inline
template<class T, unsigned int N>
T& Array< T, N >::operator[] ( const unsigned int  i)
inline
template<class T, unsigned int N>
const T& Array< T, N >::operator[] ( const unsigned int  i) const
inline
template<class T, unsigned int N>
void Array< T, N >::set ( const unsigned int  n,
const T  a 
)
inline

Member Data Documentation

template<class T, unsigned int N>
T Array< T, N >::vals[N]
protected

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