template<class Type> class List

a simple class for a List.


public members:

List ()
default constructor
List (const List <Type>& )
copy constructor
const Type& operator[] (const int i) const
returns the $i$th element of the List, un-writable
Type& operator[] (const int )
returns the $i$th element of the List, writable
List <Type> normalize ()
normalize the List
List <Type>& reset ()
reset the List elements to be zero
int length ()
returns the length of the List
Type last ()
returns the last element of the List
Type first ()
returns the first element of the List
Vector <Type> ToVect ()
copy the current List to a Vector
Vector <Type> ToVect (int m)
copy the first $m$ elements to a Vector
List <Type>& operator+= (const Type )
append an element to the current List
List <Type>& operator+= (const List <Type>& list)
append a List $list$ to the current List
List <Type>& operator= (const List <Type>& )
assign the List $list$ to the current List
int operator== (const List <Type>& list )
check if the List $list$ is the same as the current list
int In (Type c)
check if $c$ is one of the elements of the current list. Returns the position index if is in, otherwise, returns -1.
friend List <Type> ToList ( Vector <Type>& v)
a friend function, assign the elements of $v$ to a List
friend ostream& operator << (ostream& , const List <Type>& )
a friend function, stream output
friend istream& operator >> (istream& , List <Type>& )
a friend function, stream input

protected members:

void addvals (const int n , const Type* dv)
add values to the List
void ensureSubs (const int i)
check if i is a valid index


This class was modified after the class DList from Martin Smith.

this class has no child classes.

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling