Datatype for an element of an finite field with characteristik 'CHAR'. More...
#include <fastNumber.h>
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 |
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!
Definition at line 244 of file fastNumber.h.
typedef TScalar number_eps0< CHAR, TScalar >::scalarType |
Definition at line 252 of file fastNumber.h.
anonymous enum |
Definition at line 258 of file fastNumber.h.
number_eps0< CHAR, TScalar >::number_eps0 | ( | ) | [inline] |
Definition at line 505 of file fastNumber.cpp.
number_eps0< CHAR, TScalar >::number_eps0 | ( | TScalar | _x | ) | [inline] |
create .x from (_x).
Definition at line 515 of file fastNumber.cpp.
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.
number_eps0< CHAR, TScalar >::number_eps0 | ( | int | epsPrec, | |
std::string | dummy | |||
) | [inline] |
einheitlicher Konstruktor fuer eine Zahl mit belibigen EpsPrecision
Definition at line 538 of file fastNumber.cpp.
TScalar number_eps0< CHAR, TScalar >::getEps | ( | ) | const [inline] |
Definition at line 602 of file fastNumber.cpp.
short number_eps0< CHAR, TScalar >::getEpsDegree | ( | ) | const [inline] |
Definition at line 576 of file fastNumber.cpp.
References number_eps0< CHAR, TScalar >::getX().
unsigned short number_eps0< CHAR, TScalar >::getEpsPrecision | ( | ) | const [inline] |
Definition at line 290 of file fastNumber.h.
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.
size_t number_eps0< CHAR, TScalar >::getMaxSingleIndex | ( | const TScalar | characteristic | ) | [inline, static] |
Definition at line 731 of file fastNumber.cpp.
size_t number_eps0< CHAR, TScalar >::getPairIndex | ( | const number_eps0< CHAR, TScalar > | a, | |
const number_eps0< CHAR, TScalar > | b | |||
) | [inline, static] |
Definition at line 665 of file fastNumber.cpp.
References number_eps0< CHAR, TScalar >::bitsize, and number_eps0< CHAR, TScalar >::x.
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.
size_t number_eps0< CHAR, TScalar >::getPairIndexByRef | ( | const number_eps0< CHAR, TScalar > & | a, | |
const number_eps0< CHAR, TScalar > & | b | |||
) | [inline, static] |
Definition at line 679 of file fastNumber.cpp.
References number_eps0< CHAR, TScalar >::bitsize, and number_eps0< CHAR, TScalar >::x.
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.
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.
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.
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.
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.
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.
TScalar number_eps0< CHAR, TScalar >::getX | ( | ) | const [inline] |
Definition at line 587 of file fastNumber.cpp.
References number_eps0< CHAR, TScalar >::x.
Referenced by number_eps0< CHAR, TScalar >::getEpsDegree().
bool number_eps0< CHAR, TScalar >::isNotZero | ( | ) | const [inline] |
Definition at line 756 of file fastNumber.cpp.
References number_eps0< CHAR, TScalar >::x.
bool number_eps0< CHAR, TScalar >::isZero | ( | ) | const [inline] |
Definition at line 748 of file fastNumber.cpp.
References number_eps0< CHAR, TScalar >::x.
static bool number_eps0< CHAR, TScalar >::memsetClearAllowed | ( | ) | [inline, static] |
Definition at line 276 of file fastNumber.h.
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.
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.
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.
void number_eps0< CHAR, TScalar >::setEps | ( | const TScalar | eps | ) | const [inline] |
Definition at line 610 of file fastNumber.cpp.
void number_eps0< CHAR, TScalar >::setValue | ( | unsigned short | _epsExponent, | |
TScalar | coeff | |||
) | [inline] |
set .x to 'coeff' if _epsExponent==0, otherwise nothing
_epsExponent | beinhaltet die epsilon--Potenz von val - mit val ist gemeint VAL=coeff*(eps^eps_exponent) |
Definition at line 636 of file fastNumber.cpp.
References number_eps0< CHAR, TScalar >::x.
void number_eps0< CHAR, TScalar >::setX | ( | const TScalar | _x | ) | [inline] |
Definition at line 594 of file fastNumber.cpp.
References number_eps0< CHAR, TScalar >::x.
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().
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().
const number_eps0< CHAR, TScalar > number_eps0< CHAR, TScalar >::One [inline, static] |
Definition at line 255 of file fastNumber.h.
TScalar number_eps0< CHAR, TScalar >::x |
Definition at line 250 of file fastNumber.h.
Referenced by number_eps0< CHAR, TScalar >::getPairIndex(), number_eps0< CHAR, TScalar >::getPairIndexByRef(), number_eps0< CHAR, TScalar >::getSingleIndex(), number_eps0< CHAR, TScalar >::getSingleIndexByRef(), number_eps0< CHAR, TScalar >::getValue(), number_eps0< CHAR, TScalar >::getX(), number_eps0< CHAR, TScalar >::isNotZero(), number_eps0< CHAR, TScalar >::isZero(), number_eps0< CHAR, TScalar >::nearlyEqual(), number_eps0< CHAR, TScalar >::operator!=(), number_eps0< CHAR, TScalar >::operator==(), number_eps0< CHAR, TScalar >::setValue(), and number_eps0< CHAR, TScalar >::setX().
const number_eps0< CHAR, TScalar > number_eps0< CHAR, TScalar >::Zero [inline, static] |
Definition at line 254 of file fastNumber.h.