Purple::Vector< Type > Class Template Reference

List of all members.

Public Member Functions

 Vector ()
 Vector (int)
 Vector (int, const Type &)
 Vector (int, const Type *)
 Vector (const Vector &)
Vectoroperator= (const Vector &)
Type & operator[] (const int)
const Type & operator[] (const int) const
int getSize ()
Type * begin ()
Type * end ()
 ~Vector ()

Private Attributes

int size
Type * vector

Detailed Description

template<class Type>
class Purple::Vector< Type >

This template class defines a vector for general purpose use.

See also:
Matrix.

Definition at line 24 of file Vector.h.


Constructor & Destructor Documentation

template<typename Type>
Purple::Vector< Type >::Vector (  ) 

Default constructor. It creates a vector of size zero.

Definition at line 84 of file Vector.h.

template<typename Type>
Purple::Vector< Type >::Vector ( int  newSize  ) 

Constructor. It creates a vector of size n, containing n copies of the default value for Type.

Parameters:
newSize,: Size of Vector.

Definition at line 96 of file Vector.h.

template<typename Type>
Purple::Vector< Type >::Vector ( int  newSize,
const Type &  type 
)

Constructor. It creates a vector of size n, containing n copies of the type value of Type.

Parameters:
newSize,: Size of Vector.
type,: Value of Type.

Definition at line 109 of file Vector.h.

template<typename Type>
Purple::Vector< Type >::Vector ( int  newSize,
const Type *  type 
)

Constructor. It creates a vector of size n, containing n copies of the type value of Type.

Parameters:
newSize,: Size of Vector.
type,: Value of Type.

Definition at line 125 of file Vector.h.

template<class Type>
Purple::Vector< Type >::Vector ( const Vector< Type > &   ) 

template<typename Type>
Purple::Vector< Type >::~Vector (  ) 

Destructor.

Definition at line 240 of file Vector.h.


Member Function Documentation

template<class Type>
Vector& Purple::Vector< Type >::operator= ( const Vector< Type > &   ) 

template<typename Type>
Type & Purple::Vector< Type >::operator[] ( const   int  ) 

Reference operator.

Definition at line 186 of file Vector.h.

template<typename Type>
const Type & Purple::Vector< Type >::operator[] ( const   int  )  const

Reference operator.

Definition at line 194 of file Vector.h.

template<typename Type>
int Purple::Vector< Type >::getSize (  ) 

This method returns the number of elements in the vector.

Definition at line 207 of file Vector.h.

template<typename Type>
Type * Purple::Vector< Type >::begin (  ) 

This method returns a pointer to the first element in the container.

Definition at line 218 of file Vector.h.

template<typename Type>
Type * Purple::Vector< Type >::end (  ) 

This method returns a pointer to the last element in the container.

Definition at line 229 of file Vector.h.


Member Data Documentation

template<class Type>
int Purple::Vector< Type >::size [private]

Size of vector.

Definition at line 31 of file Vector.h.

template<class Type>
Type* Purple::Vector< Type >::vector [private]

Pointer to a Type.

Definition at line 35 of file Vector.h.


Generated on Wed Jun 21 13:10:38 2006 for Purple by  doxygen 1.4.7