number_eps0< CHAR, TScalar > Class Template Reference
[Algebra objectsField and Ring elements]

Datatype for an element of an finite field with characteristik 'CHAR'. More...

#include <fastNumber.h>

Collaboration diagram for number_eps0< CHAR, TScalar >:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { bitsize = needbits<CHAR>::value }
typedef TScalar scalarType
 number datatype

Public Member Functions

Constructors

 number_eps0 ()
 value is set to Zero;
 number_eps0 (TScalar _x)
 create number_eps0, .x ist set to _x.
 number_eps0 (TScalar _x, TScalar eps)
 create number_eps0, .x ist set to _x, eps is ignored
 number_eps0 (int epsPrec, std::string dummy)
 create number_eps0 with epsprecision=epsPrec. fails if epsPrec is not 0
properties

unsigned short getEpsPrecision () const
short getEpsDegree () const
 returns the highest EpsExponent where the coeffitient is not zero.
data access

TScalar getX () const
void setX (const TScalar _x)
TScalar getEps () const
 returns 0
void setEps (const TScalar eps) const
void setValue (unsigned short _epsExp, TScalar coeff)
 sets entweder .x to coeff if _epsExp==0, otherwise does nothing
int getValue (unsigned short _epsExp) const
operators

bool isZero () const
bool isNotZero () const
bool nearlyEqual (const number_eps0 z) const
 compare only the .x-Component
int operator== (const number_eps0 &z) const
int operator!= (const number_eps0 &z) const

Static Public Member Functions

safety

static bool memsetClearAllowed ()
 returns true, if it is allowed to initialise class objects with memset(0)
static bool wellDefined ()
static bool wellDefined (unsigned int characteristic)
index computation regular interface

static size_t getPairIndex (const number_eps0< CHAR, TScalar > a, const number_eps0< CHAR, TScalar > b, const TScalar characteristic)
 returns a.x*(2^bitsize) + b.x
static size_t getPairIndexByRef (const number_eps0< CHAR, TScalar > &a, const number_eps0< CHAR, TScalar > &b, const TScalar &characteristic)
 returns a.x*(2^bitsize) + b.x
static size_t getSingleIndex (const number_eps0< CHAR, TScalar > b, const TScalar characteristic)
 returns b.x
static size_t getSingleIndexByRef (const number_eps0< CHAR, TScalar > &b, const TScalar &characteristic)
 returns b.x
static size_t getMaxSingleIndex (const TScalar characteristic)
static size_t getMaxPairIndex (const TScalar characteristic)
index computation reduced interface

static size_t getPairIndex (const number_eps0< CHAR, TScalar > a, const number_eps0< CHAR, TScalar > b)
 returns a.x*(2^bitsize) + b.x
static size_t getPairIndexByRef (const number_eps0< CHAR, TScalar > &a, const number_eps0< CHAR, TScalar > &b)
 returns a.x*(2^bitsize) + b.x
static size_t getSingleIndex (const number_eps0< CHAR, TScalar > b)
 returns b.x
static size_t getSingleIndexByRef (const number_eps0< CHAR, TScalar > &b)
 returns b.x

Public Attributes

TScalar x
 number_eps0 data

Static Public Attributes

static const number_eps0 Zero
static const number_eps0 One

Detailed Description

template<int CHAR, class TScalar>
class number_eps0< CHAR, TScalar >

datatype for (x,); -----------number_eps0 DATA LAYOUT--------------------
Data is stored in a 'TScalar' as follows:
first 'bitsize' bits for 'x' and no 'bits' for epsilon!

Template parameter CHAR determines the maximal possible regular value.
The TScalar is the internal type for the stored value.

Der Template-Parameter CHAR ist die Charakteristik des Koerpers, dessen Werte in number_eps0.x dargestellbar sein sollen. maximal zulaessiger CHAR-Wert haengt vom Template-Datentyp 'datatype' ab!

Todo:
Sicherheitspruefung: maximal zulaessiger Template-Parameter CHAR <=sizeof(datatype)*8!
Todo:
warnen, wenn als DataType ein unsigned ding verwendet wird
Todo:
einmalig warnen wenn (bitsize>=sizeof(TScalar)*8) - dann kann nicht im Speicher subtrahiert werden
Todo:
einmalig warnen wenn (bitsize>=(sizeof(TScalar)-1)*8) - dann kann nicht im Speicher addiert werden (es kommt zum Überlauf)
Todo:
size_t or NOT size_t as return type for index funtions?
Todo:
in den Indexfunktionen eventuell bitsize durch needbits<CHAR>::value ersetzen, weil schneller!

Definition at line 244 of file fastNumber.h.


Member Typedef Documentation

template<int CHAR, class TScalar>
typedef TScalar number_eps0< CHAR, TScalar >::scalarType

Definition at line 252 of file fastNumber.h.


Member Enumeration Documentation

template<int CHAR, class TScalar>
anonymous enum
Todo:
3rd template parameter with delivers reserved bits for stored data
Enumerator:
bitsize 

Definition at line 258 of file fastNumber.h.


Constructor & Destructor Documentation

template<int CHAR, class TScalar >
number_eps0< CHAR, TScalar >::number_eps0 (  )  [inline]

Definition at line 505 of file fastNumber.cpp.

template<int CHAR, class TScalar >
number_eps0< CHAR, TScalar >::number_eps0 ( TScalar  _x  )  [inline]
Todo:
: es sollte waehrend des Compilevorgangs oder zumindest einmal während des Programmstarts geprueft werden, ob der interne Datentyp groß genug ausgelegt ist.

create .x from (_x).

Definition at line 515 of file fastNumber.cpp.

template<int CHAR, class TScalar >
number_eps0< CHAR, TScalar >::number_eps0 ( TScalar  _x,
TScalar  eps 
) [inline]

create .x from (_x,eps). eps is ignored

Definition at line 524 of file fastNumber.cpp.

template<int CHAR, class TScalar >
number_eps0< CHAR, TScalar >::number_eps0 ( int  epsPrec,
std::string  dummy 
) [inline]

einheitlicher Konstruktor fuer eine Zahl mit belibigen EpsPrecision

Todo:
Konstruktor fuer eine Zahl mit belibigen EpsPrecision: Problem: eine 0 wird als leerer String interpretiert, bzw. ein char als ein Integer-Wert. Insgesamt noch keine gute Loesung.

Definition at line 538 of file fastNumber.cpp.


Member Function Documentation

template<int CHAR, class TScalar >
TScalar number_eps0< CHAR, TScalar >::getEps (  )  const [inline]

Definition at line 602 of file fastNumber.cpp.

template<int CHAR, class TScalar >
short number_eps0< CHAR, TScalar >::getEpsDegree (  )  const [inline]

Definition at line 576 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::getX().

Here is the call graph for this function:

template<int CHAR, class TScalar>
unsigned short number_eps0< CHAR, TScalar >::getEpsPrecision (  )  const [inline]

Definition at line 290 of file fastNumber.h.

template<int CHAR, class TScalar >
size_t number_eps0< CHAR, TScalar >::getMaxPairIndex ( const TScalar  characteristic  )  [inline, static]

Definition at line 739 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::bitsize.

template<int CHAR, class TScalar >
size_t number_eps0< CHAR, TScalar >::getMaxSingleIndex ( const TScalar  characteristic  )  [inline, static]

Definition at line 731 of file fastNumber.cpp.

template<int CHAR, class TScalar >
size_t number_eps0< CHAR, TScalar >::getPairIndex ( const number_eps0< CHAR, TScalar >  a,
const number_eps0< CHAR, TScalar >  b 
) [inline, static]
template<int CHAR, class TScalar >
size_t number_eps0< CHAR, TScalar >::getPairIndex ( const number_eps0< CHAR, TScalar >  a,
const number_eps0< CHAR, TScalar >  b,
const TScalar  characteristic 
) [inline, static]

Definition at line 711 of file fastNumber.cpp.

template<int CHAR, class TScalar >
size_t number_eps0< CHAR, TScalar >::getPairIndexByRef ( const number_eps0< CHAR, TScalar > &  a,
const number_eps0< CHAR, TScalar > &  b 
) [inline, static]
template<int CHAR, class TScalar >
size_t number_eps0< CHAR, TScalar >::getPairIndexByRef ( const number_eps0< CHAR, TScalar > &  a,
const number_eps0< CHAR, TScalar > &  b,
const TScalar &  characteristic 
) [inline, static]

Definition at line 721 of file fastNumber.cpp.

template<int CHAR, class TScalar >
size_t number_eps0< CHAR, TScalar >::getSingleIndex ( const number_eps0< CHAR, TScalar >  b  )  [inline, static]

Definition at line 650 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::x.

template<int CHAR, class TScalar >
size_t number_eps0< CHAR, TScalar >::getSingleIndex ( const number_eps0< CHAR, TScalar >  b,
const TScalar  characteristic 
) [inline, static]

Definition at line 693 of file fastNumber.cpp.

template<int CHAR, class TScalar >
size_t number_eps0< CHAR, TScalar >::getSingleIndexByRef ( const number_eps0< CHAR, TScalar > &  b  )  [inline, static]

Definition at line 658 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::x.

template<int CHAR, class TScalar >
size_t number_eps0< CHAR, TScalar >::getSingleIndexByRef ( const number_eps0< CHAR, TScalar > &  b,
const TScalar &  characteristic 
) [inline, static]

Definition at line 702 of file fastNumber.cpp.

template<int CHAR, class TScalar >
int number_eps0< CHAR, TScalar >::getValue ( unsigned short  _epsExp  )  const [inline]

Definition at line 619 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::x.

template<int CHAR, class TScalar >
TScalar number_eps0< CHAR, TScalar >::getX (  )  const [inline]
template<int CHAR, class TScalar >
bool number_eps0< CHAR, TScalar >::isNotZero (  )  const [inline]

Definition at line 756 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::x.

template<int CHAR, class TScalar >
bool number_eps0< CHAR, TScalar >::isZero (  )  const [inline]

Definition at line 748 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::x.

template<int CHAR, class TScalar>
static bool number_eps0< CHAR, TScalar >::memsetClearAllowed (  )  [inline, static]

Definition at line 276 of file fastNumber.h.

template<int CHAR, class TScalar >
bool number_eps0< CHAR, TScalar >::nearlyEqual ( const number_eps0< CHAR, TScalar >  z  )  const [inline]

Definition at line 764 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::x.

template<int CHAR, class TScalar >
int number_eps0< CHAR, TScalar >::operator!= ( const number_eps0< CHAR, TScalar > &  z  )  const [inline]

Definition at line 780 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::x.

template<int CHAR, class TScalar >
int number_eps0< CHAR, TScalar >::operator== ( const number_eps0< CHAR, TScalar > &  z  )  const [inline]

Definition at line 772 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::x.

template<int CHAR, class TScalar >
void number_eps0< CHAR, TScalar >::setEps ( const TScalar  eps  )  const [inline]

Definition at line 610 of file fastNumber.cpp.

template<int CHAR, class TScalar >
void number_eps0< CHAR, TScalar >::setValue ( unsigned short  _epsExponent,
TScalar  coeff 
) [inline]

set .x to 'coeff' if _epsExponent==0, otherwise nothing

Parameters:
_epsExponent beinhaltet die epsilon--Potenz von val - mit val ist gemeint VAL=coeff*(eps^eps_exponent)
Todo:
Funktionsbezeichnung ungluecklich, setMonom passt aber auch nicht

Definition at line 636 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::x.

template<int CHAR, class TScalar >
void number_eps0< CHAR, TScalar >::setX ( const TScalar  _x  )  [inline]

Definition at line 594 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::x.

template<int CHAR, class TScalar>
static bool number_eps0< CHAR, TScalar >::wellDefined ( unsigned int  characteristic  )  [inline, static]

Definition at line 280 of file fastNumber.h.

References number_eps1< CHAR, TScalar, TScalarPair >::wellDefined().

Here is the call graph for this function:

template<int CHAR, class TScalar >
bool number_eps0< CHAR, TScalar >::wellDefined (  )  [inline, static]

Definition at line 552 of file fastNumber.cpp.

References number_eps0< CHAR, TScalar >::bitsize, and make::test().

Here is the call graph for this function:


Member Data Documentation

template<int CHAR, class TScalar>
const number_eps0< CHAR, TScalar > number_eps0< CHAR, TScalar >::One [inline, static]

Definition at line 255 of file fastNumber.h.

template<int CHAR, class TScalar>
TScalar number_eps0< CHAR, TScalar >::x
template<int CHAR, class TScalar>
const number_eps0< CHAR, TScalar > number_eps0< CHAR, TScalar >::Zero [inline, static]

Definition at line 254 of file fastNumber.h.


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