contains template parameter definition for fast_polynomXY (Traits), parametrized by characteristic(field) during compile time. The design was more try and error than applying common metaprogramming concepts, but this schould be the right way More...
#include <polynomdefs.h>
Public Types | |
enum | { maxdegree_m = nextpow2num<DEGREE>::value - 1 } |
enum | { size_m = (nextpow2num<DEGREE>::value)*(nextpow2num<DEGREE>::value) } |
Public Member Functions | |
int | getSize () const |
Static Public Member Functions | |
static bool | wellDefined () |
static short | getPairIndex (const short a, const short b) |
compute a*(2^pshift)+b | |
Private Types | |
enum | { pshift_m = needbits<DEGREE>::value } |
due to compile problems with some compilers enums are used instead of regular member variables More... |
der Aufbau ist wie folgt: polynomdefs definiert (zur Kompilezeit) beispielsweise den inneren Datenaufbau von improved_polynom (polynom in zwei Variablen)
Erreichte Optimierung Durch die Shift-Operation in getPairIndex wird der Zugriff auf eine Polynomkoeffizient
(k*(x^a)*(y^b), a und b {0..DEGREE} )
beschleunigt.
Nachteil: ist DEGREE keine Zweierpotenz, so muss für die Polynomkoeffizienten ein unnoetig groesseres Array definiert werden, in welchem nicht alle Eintraege belegt sind. Dies führt wieder zu vermehrten Cache Misses
improved_polynom haengt aber auch vom Datentyp des Polynomkoeffizienten ab, ich weiss momentan nur nicht, wie ich den Dateintyp als typedef-Variable in polynomdefs festlege
ein Problem ist der dynamische Aspekt: wie kann man 'improved_polynom' auch mit einem Objekt und nicht mit statischen Daten initialiesieren?
DEGREE | ist der maximal verwendete Grad des Polynoms (in zwei Variablen.) |
: Ueberpruefung auf DEGREE kleiner 128, wegen "static const short pshift" - wieso, DAS ist kein Problem, aber eine wellDefined-Funktion sollte programmiert werden.
Korrektheit: Polynomdefs alle falsch, nur durch die Tatsache, dass nextpow2num(3)=4 ist (hoffentlich), passen die Größen doch und es gibt keine Speicherschutzverletzung
Definition at line 60 of file polynomdefs.h.
anonymous enum [private] |
Definition at line 64 of file polynomdefs.h.
anonymous enum |
Definition at line 68 of file polynomdefs.h.
anonymous enum |
size_m |
Anzahl bytes, die von einem arrayindex der Polynomkoeffizientenliste belegt werden
|
Definition at line 72 of file polynomdefs.h.
static short polynomdefs< DEGREE >::getPairIndex | ( | const short | a, | |
const short | b | |||
) | [inline, static] |
Definition at line 81 of file polynomdefs.h.
int polynomdefs< DEGREE >::getSize | ( | ) | const [inline] |
Definition at line 71 of file polynomdefs.h.
References polynomdefs< DEGREE >::size_m.
static bool polynomdefs< DEGREE >::wellDefined | ( | ) | [inline, static] |
Definition at line 76 of file polynomdefs.h.