Random
Hello,
This is a PR related to Random generators. In the actual Garfield code the RandomEngines
are childs of the mother RandomEngine
class and as such need vtables. It seems the design choice was to be able to redefine an other engine, however this is not done in the code for now and the change of generator from the user code seems to be impossible. The actual PR try to keep the original idea of being able to inherit from RandomEngine but with some benefits:
- Using Curiously recurring template pattern to avoid vtable as this class is used extenssively in Garfield
- Implement a basic RandomEngineSTL using generator from the STL ''
- By default the engine is still TRandom3
- User can define his own engine for test or speed depending on machine etc...
- It is possible to switch the engine in the usercode directly and Garfirld will use this engine to generate all his random values.
While doing the change I have found some comment saying it would be nice to disentangle Heed from Garfield as they are just linked together because of the random generator. I have so make the change for this. Now the code is compiled in three libraries :
GarfieldRandom, Grafield and Heed, the last two are using the first one and are now totally separated.
Heed provided some distribution like 'poissonian' etc.; different from the one done by garfield, these code are a kind of duplication and have been removed. Now Heed use Garfield distributions code.