NAMD
Public Types | Public Member Functions | Public Attributes | List of all members
Array< Elem, Size > Class Template Reference

#include <Array.h>

Inheritance diagram for Array< Elem, Size >:
MathArray< Elem, Size > MathArray< double, 7 >

Public Types

typedef Elem * iterator
 
typedef const Elem * const_iterator
 

Public Member Functions

 Array (void)
 
 ~Array (void)
 
 Array (const Array< Elem, Size > &a2)
 
Array< Elem, Size > & operator= (const Array< Elem, Size > &a2)
 
 Array (const Elem &v)
 
Array< Elem, Size > & operator= (const Elem &v)
 
Elem & operator[] (int index)
 
const Elem & operator[] (int index) const
 
iterator begin (void)
 
iterator end (void)
 
const_iterator const_begin (void) const
 
const_iterator const_end (void) const
 

Public Attributes

Elem data [Size]
 

Detailed Description

template<class Elem, int Size>
class Array< Elem, Size >

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 10 of file Array.h.

Member Typedef Documentation

template<class Elem, int Size>
typedef const Elem* Array< Elem, Size >::const_iterator

Definition at line 49 of file Array.h.

template<class Elem, int Size>
typedef Elem* Array< Elem, Size >::iterator

Definition at line 46 of file Array.h.

Constructor & Destructor Documentation

template<class Elem, int Size>
Array< Elem, Size >::Array ( void  )
inline

Definition at line 16 of file Array.h.

16 { ; }
template<class Elem, int Size>
Array< Elem, Size >::~Array ( void  )
inline

Definition at line 19 of file Array.h.

19 { ; }
template<class Elem, int Size>
Array< Elem, Size >::Array ( const Array< Elem, Size > &  a2)
inline

Definition at line 22 of file Array.h.

22  {
23  for ( int i = 0; i < Size; ++i ) { data[i] = a2.data[i]; }
24  }
Elem data[Size]
Definition: Array.h:13
template<class Elem, int Size>
Array< Elem, Size >::Array ( const Elem &  v)
inline

Definition at line 33 of file Array.h.

33  {
34  for ( int i = 0; i < Size; ++i ) { data[i] = v; }
35  }
Elem data[Size]
Definition: Array.h:13

Member Function Documentation

template<class Elem, int Size>
iterator Array< Elem, Size >::begin ( void  )
inline

Definition at line 47 of file Array.h.

47 { return &data[0]; }
Elem data[Size]
Definition: Array.h:13
template<class Elem, int Size>
const_iterator Array< Elem, Size >::const_begin ( void  ) const
inline

Definition at line 50 of file Array.h.

50 { return &data[0]; }
Elem data[Size]
Definition: Array.h:13
template<class Elem, int Size>
const_iterator Array< Elem, Size >::const_end ( void  ) const
inline

Definition at line 51 of file Array.h.

51 { return &data[0] + Size; }
Elem data[Size]
Definition: Array.h:13
template<class Elem, int Size>
iterator Array< Elem, Size >::end ( void  )
inline

Definition at line 48 of file Array.h.

48 { return &data[0] + Size; }
Elem data[Size]
Definition: Array.h:13
template<class Elem, int Size>
Array<Elem,Size>& Array< Elem, Size >::operator= ( const Array< Elem, Size > &  a2)
inline

Definition at line 27 of file Array.h.

Referenced by MathArray< double, 7 >::operator=().

27  {
28  for ( int i = 0; i < Size; ++i ) { data[i] = a2.data[i]; }
29  return (*this);
30  }
Elem data[Size]
Definition: Array.h:13
template<class Elem, int Size>
Array<Elem,Size>& Array< Elem, Size >::operator= ( const Elem &  v)
inline

Definition at line 36 of file Array.h.

36  {
37  for ( int i = 0; i < Size; ++i ) { data[i] = v; }
38  return (*this);
39  }
Elem data[Size]
Definition: Array.h:13
template<class Elem, int Size>
Elem& Array< Elem, Size >::operator[] ( int  index)
inline

Definition at line 42 of file Array.h.

42 { return data[index]; }
Elem data[Size]
Definition: Array.h:13
template<class Elem, int Size>
const Elem& Array< Elem, Size >::operator[] ( int  index) const
inline

Definition at line 43 of file Array.h.

43 { return data[index]; }
Elem data[Size]
Definition: Array.h:13

Member Data Documentation

template<class Elem, int Size>
Elem Array< Elem, Size >::data[Size]

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