template <class Type> class Vector

a base and generic vector

Inheritance:


public members:

Vector ()
Default constructor with length 0
Vector (int m)
constructor a vector of length $m$
Vector (const Vector <Type>& v)
constructor a vector of the same as $v$
Vector (int m, Type* x)
constructor a vector of length $m$ with elements the same as first $m$ elements of arrays x
Vector (int l, int m, Type* x)
constructor a vector of length $l$ with elements the same as first $m$ elements of arrays x, the rest have the value of $x[m-1]$
int size () const
returns size of the vector
Type operator[] (int i) const
acess the ith element, non-writable
Type& operator[] (int i)
acess the ith element, writable
Type* toPointer () const
returns the conent as an array
Vector <Type>& setPointer (Type* p )
assigns conents of array p to the vector
Vector <Type>& chaSize (int m)
change size of the vector to $m$
Vector <Type>& linear (Type iv, Type s)
assigns a linear related contents, $a[i] = iv + s*i$
int indexMax () const
simple operations
int indexMin () const
Type max () const
Type min () const
Type sum () const
Type norm (int p ) const
Type norm2S ()const
Vector <Type>& normalize ()
Vector <Type> operator- ()
negate all components
Vector <Type> abs ()
absolute value of all components
Vector <Type>& operator= (const Vector <Type>& v)
overlodaing = operator, equating the vector to v
Vector <Type>& operator= (Type c)
overloading = operator, assigning a constant c to the Vector
Vector <Type>& operator= (Type * p )
overload = operator, assigning an array to the Vector
Vector <Type>& operator+= (const Vector <Type>& v)
overlodaing += operator
Vector <Type>& operator+= (Type c)
Vector <Type>& operator+= (Type * p )
Vector <Type>& operator-= (const Vector <Type>& v)
overloading -= operator
Vector <Type>& operator-= (Type c)
Vector <Type>& operator-= (Type * p )
Vector <Type>& operator*= (Type c)
overloading *= /= operators
Vector <Type>& operator/= (Type c)
Vector <Type>& addVal (Type)
joining elements to the vector
Vector <Type>& addVal (const Vector <Type>&)
Vector <Type>& addVal (Type, int)
size_t bfread (FILE *ifp)
size_t bfwrite (FILE *ofp)
Type CircElem (int i) const
additional methods
Vector <Type>* copy (int)
Vector <Type>* copy (int, int)
int in (Type c) const
friend ostream& operator<< (ostream&, const Vector <Type>&)
overloading insertion and extraction operators
friend istream& operator>> (istream&, Vector <Type>&)
friend int operator== (const Vector <Type>& u, Type c)
comparing a vector with a number, ==
friend int operator!= (const Vector <Type>& u, Type c)
comparing a vector with a number, !=
friend int operator== (const Vector <Type>& u, const Vector <Type>& c)
comparing two vectors, ==
friend int operator!= (const Vector <Type>& u, const Vector <Type>& c)
comparing two vectors, !=

Documentation

This class tends to be as generic as possible

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