Alsvinn
0.5.3
The fast FVM simulator with UQ support
|
#include <alsuq/distribution/DLLDistribution.hpp>
Public Types | |
typedef void * | DLLData |
Public Member Functions | |
DLLDistribution (size_t numberOfSamples, size_t dimension, const Parameters ¶meters) | |
virtual | ~DLLDistribution () |
virtual real | generate (generator::Generator &generator, size_t component, size_t sample) override |
Generates the next number from the DLL. More... | |
![]() | |
virtual | ~Distribution () |
The DLL Distribution loads functions dynamically from a user specified DLL file (shared library) at run time.
This is ideal when you want to use some third party QMC module that you don't want to include into the project
The parameters you can supply are
parameter name | description |
---|---|
library | filename of dll |
create_function | name of the create function, should have the following signature use NONE if it is not supplied |
delete_function | the function to delete any data created, if create_function is NONE, this is ignored assumes signature void delete_function(void* data); |
generator_function | the name of the genreator function assumes signature real generator_function(void* data, int size, int dimension, int component, int sample, void* parameters); |
make_parameters_function | Name of the function to create the parameter struct assumes the signature void* make_parameters_function(); |
delete_parameters_function | name of the function to delete the parameter struct assumes the signature |
set_parameter_function | set the parameter, assumes the signature |
set_parameter_function will be called for every parameter given to the distribution tag, ie if the xml given was
the following code will essentially be called
To get an idea on how this is called, this is a rough sketch (the code assumes every option is set, there are some if tests to check that the user supplied every function, otherwise they are gracefully skipped):
typedef void* alsuq::distribution::DLLDistribution::DLLData |
alsuq::distribution::DLLDistribution::DLLDistribution | ( | size_t | numberOfSamples, |
size_t | dimension, | ||
const Parameters & | parameters | ||
) |
|
virtual |
|
overridevirtual |
Generates the next number from the DLL.
Implements alsuq::distribution::Distribution.