TVector< TRing > Class Template Reference
[Algebra objectsVectors and Matrices]

Template vector class. May filled with elements of TRing. Vectorsize is shrinked to size_t. More...

#include <TVector.h>

Collaboration diagram for TVector< TRing >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef TRing::ElementType TNum
 TRing element type.

Public Member Functions

Constructors, Destructor

 TVector (size_t _size, const TRing *_ring, string _name="unnamedVector")
 Creates a zero TVector of size size with elements in _ring. (vector[i] = TNum::Zero, i is in 0,..,(size-1).
template<class _istream >
 TVector (const TRing *_ring, _istream &_vectorStream, string _name="unnamedVector")
 Creates TVector from a stream, with elements in _ring. Currently only integer entries are supported. Required stream format style is like : {1,22,33,...}.
 TVector (string _vectorStr, const TRing *_ring, string _name="unnamedVector")
 Creates TVector from a string, with elements in _ring. Currently only integer entries are supported. Required string format style is like : {1,22,33,...}.
virtual ~TVector ()
properties

size_t getSize () const
 get vector size
string getName () const
void setName (string _name)
const TRing * getRing () const
initialising

void fillZero ()
 fill all elements with TNum::Zero
void randomInit (long *_pRandomSeed)
 Init all entries with random TRing elements. _pZufallSeed has to point to a random seed, which is used by ran2() random generator randomInit. Only implemented for (ring1->getEpsPrecision==0).
value access

TNumoperator[] (const size_t pos)
TNum getVal (const size_t _pos) const
 _pos is 0-based!
const TNumgetConstValRef (const size_t _pos) const
 _pos is 0-based!
TNumgetValRef (const size_t _pos)
 _pos is 0-based!
void setVal (const size_t _pos, const TNum _z)
 _pos is 0-based!
void setValByRef (const size_t _pos, const TNum &_z)
 _pos is 0-based!
operators

bool isZero () const
 checks if vector is zero
bool isNotZero () const
 checks if vector is zero
bool operator== (TVector &vec) const
bool operator!= (TVector &vec) const
IO

void outputAsMatrix (ostream &_os)
 output vector in Macaulay style ( "name = value ; " )

Protected Member Functions

Construction

template<class _istream >
void createFromStream (_istream &_vectorStream)
 /// Reads a vector from a stream. Currently, createFromStream() works only for vectors with integer elements. Required format style is {1,22,33,...}
Safety

void checkBounds (size_t pos) const

Private Attributes

const TRing * ring
 pointer to an object with operations on TRing elements TNum.
size_t size
 vector dimension
TNumdata
 vector data
string name
 object name

Detailed Description

template<class TRing>
class TVector< TRing >

Todo:

add static ring pointer to TNum class?

operator[] implementieren?

Definition at line 25 of file TVector.h.


Member Typedef Documentation

template<class TRing>
typedef TRing::ElementType TVector< TRing >::TNum

Definition at line 28 of file TVector.h.


Constructor & Destructor Documentation

template<class TRing >
TVector< TRing >::TVector ( size_t  _size,
const TRing *  _ring,
string  _name = "unnamedVector" 
) [inline]
Parameters:
_size vector size
_ring a ring operating on TNum-numbers.
_name name for the current object

Definition at line 12 of file TVector.cpp.

References TVector< TRing >::data, TVector< TRing >::fillZero(), and TVector< TRing >::size.

Here is the call graph for this function:

template<class TRing >
template<class _istream >
TVector< TRing >::TVector ( const TRing *  _ring,
_istream &  _vectorStream,
string  _name = "unnamedVector" 
) [inline]

Definition at line 88 of file TVector.cpp.

template<class TRing >
TVector< TRing >::TVector ( string  _vectorStr,
const TRing *  _ring,
string  _name = "unnamedVector" 
) [inline]

Definition at line 100 of file TVector.cpp.

template<class TRing >
TVector< TRing >::~TVector (  )  [inline, virtual]

Definition at line 110 of file TVector.cpp.

References TVector< TRing >::data.


Member Function Documentation

template<class TRing >
void TVector< TRing >::checkBounds ( size_t  pos  )  const [inline, protected]
template<class TRing >
template<class _istream >
void TVector< TRing >::createFromStream ( _istream &  _dataStream  )  [inline, protected]
Todo:

implement StreamIn-Operator for TNum !;

nur istream verwenden, und statt <iostream> nur <iosfwd> im header einbinden

auftretende Fehler werden nicht

Definition at line 37 of file TVector.cpp.

References countElements(), countGroups(), TVector< TRing >::data, extractChar(), extractNextBracedData(), TVector< TRing >::ring, and TVector< TRing >::size.

Here is the call graph for this function:

template<class TRing >
void TVector< TRing >::fillZero (  )  [inline]
Todo:
die for-Schleifen-Initialisierungen durch std::fill ersetzen...

Definition at line 136 of file TVector.cpp.

References TVector< TRing >::data, and TVector< TRing >::size.

Referenced by TVector< TRing >::TVector().

template<class TRing >
const TRing::ElementType & TVector< TRing >::getConstValRef ( const size_t  _pos  )  const [inline]

Definition at line 198 of file TVector.cpp.

References TVector< TRing >::checkBounds(), and TVector< TRing >::data.

Here is the call graph for this function:

template<class TRing>
string TVector< TRing >::getName (  )  const [inline]

Definition at line 69 of file TVector.h.

References TVector< TRing >::name.

template<class TRing>
const TRing* TVector< TRing >::getRing (  )  const [inline]

Definition at line 71 of file TVector.h.

References TVector< TRing >::ring.

template<class TRing >
size_t TVector< TRing >::getSize (  )  const [inline]
template<class TRing >
TRing::ElementType TVector< TRing >::getVal ( const size_t  _pos  )  const [inline]
template<class TRing >
TRing::ElementType & TVector< TRing >::getValRef ( const size_t  _pos  )  [inline]

Definition at line 188 of file TVector.cpp.

References TVector< TRing >::checkBounds(), and TVector< TRing >::data.

Referenced by nCenterFocus::CenterFocusExperiment< variant >::liftTest_performSingleTest().

Here is the call graph for this function:

template<class TRing >
bool TVector< TRing >::isNotZero (  )  const [inline]
template<class TRing >
bool TVector< TRing >::isZero (  )  const [inline]

Definition at line 228 of file TVector.cpp.

References TVector< TRing >::data, TVector< TRing >::isNotZero(), and TVector< TRing >::size.

Here is the call graph for this function:

template<class TRing >
bool TVector< TRing >::operator!= ( TVector< TRing > &  vec  )  const [inline]

Definition at line 264 of file TVector.cpp.

References TVector< TRing >::getSize(), TVector< TRing >::getVal(), and TVector< TRing >::size.

Here is the call graph for this function:

template<class TRing >
bool TVector< TRing >::operator== ( TVector< TRing > &  vec  )  const [inline]

Definition at line 250 of file TVector.cpp.

References TVector< TRing >::getSize(), TVector< TRing >::getVal(), and TVector< TRing >::size.

Here is the call graph for this function:

template<class TRing >
TRing::ElementType & TVector< TRing >::operator[] ( const size_t  pos  )  [inline]

Definition at line 149 of file TVector.cpp.

References TVector< TRing >::checkBounds(), and TVector< TRing >::data.

Here is the call graph for this function:

template<class TRing >
void TVector< TRing >::outputAsMatrix ( ostream &  _os  )  [inline]
template<class TRing >
void TVector< TRing >::randomInit ( long *  _pRandomInit  )  [inline]

/

Todo:
: Bessere Konstruktion: randomInit bekommt ein Objekt, welches eine random()-Funktion besitzt. Dann braucht man hier keinen Ring zu speichern! / Bzw. der Ring bekommt eine Random-Fkt (oder die Zahl eine static Random fkt und einen static Ring-Verweis) / Noch besser, wenn TNum einen Verweis auf den Ring enthält! /

Definition at line 216 of file TVector.cpp.

References TVector< TRing >::data, random(), TVector< TRing >::ring, and TVector< TRing >::size.

Here is the call graph for this function:

template<class TRing>
void TVector< TRing >::setName ( string  _name  )  [inline]

Definition at line 70 of file TVector.h.

References TVector< TRing >::name.

Referenced by Matrix3D< TMatrix2D >::computeFrontalMatrixBasis().

template<class TRing >
void TVector< TRing >::setVal ( const size_t  _pos,
const TNum  _z 
) [inline]
template<class TRing>
void TVector< TRing >::setValByRef ( const size_t  _pos,
const TNum _z 
) [inline]

Member Data Documentation

template<class TRing>
TNum* TVector< TRing >::data [private]
template<class TRing>
string TVector< TRing >::name [private]
template<class TRing>
const TRing* TVector< TRing >::ring [private]
template<class TRing>
size_t TVector< TRing >::size [private]

The documentation for this class was generated from the following files:
Generated on Tue Nov 23 13:10:53 2010 for centerfocus by  doxygen 1.6.3