SG++-Doxygen-Documentation
|
Base class for all types of MonteCarlo sample generators used in SGPP. More...
#include <SampleGenerator.hpp>
Public Member Functions | |
size_t | getDimensions () |
virtual void | getSample (sgpp::base::DataVector &sample) |
Abstract Method which has to be implemented by each sample generator One single sample is generated by this method. More... | |
void | getSamples (sgpp::base::DataMatrix &samples) |
This method generates a given number of samples. More... | |
SampleGenerator (size_t dimensions, std::uint64_t seed=std::mt19937_64::default_seed) | |
Standard constructor. More... | |
void | setDimensions (size_t dimensions) |
Sets the number of dimensions for sample generation to the given value. More... | |
virtual | ~SampleGenerator () |
Protected Attributes | |
size_t | dimensions |
std::mt19937_64 | rng |
std::uint64_t | seed |
Base class for all types of MonteCarlo sample generators used in SGPP.
A sample generator is used to generate one or multiple n-dimensional sample vectors inside the n-dimensional unit cube.
|
explicit |
Standard constructor.
dimensions | number of dimensions used for sample generation |
seed | custom seed (defaults to default seed of mt19937_64) |
References rng.
|
virtual |
size_t sgpp::quadrature::SampleGenerator::getDimensions | ( | ) |
References dimensions.
Referenced by getSample().
|
inlinevirtual |
Abstract Method which has to be implemented by each sample generator One single sample is generated by this method.
The dimensionality of the parameter has to fit the number of dimensions used in this sample generator.
sample | provide a DataVector to store the generated sample. |
Reimplemented in sgpp::quadrature::LatinHypercubeSampleGenerator, sgpp::quadrature::StratifiedSampleGenerator, sgpp::quadrature::NaiveSampleGenerator, and sgpp::quadrature::HaltonSampleGenerator.
References getDimensions(), getSamples(), parabolasimple::samples, and setDimensions().
Referenced by getSamples().
void sgpp::quadrature::SampleGenerator::getSamples | ( | sgpp::base::DataMatrix & | samples | ) |
This method generates a given number of samples.
The resulting samples are written to the parameter DataMatrix. Therefore the number of cols has to fit the number of dimensions whereas the number of rows defines the number of generated samples.
samples | provide a DataMatrix to hold the generated samples |
References dimensions, sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), getSample(), python.statsfileInfo::i, and sgpp::base::DataMatrix::setRow().
Referenced by sgpp::quadrature::OperationQuadratureMCAdvanced::doQuadrature(), sgpp::quadrature::OperationQuadratureMCAdvanced::doQuadratureFunc(), sgpp::quadrature::OperationQuadratureMCAdvanced::doQuadratureL2Error(), and getSample().
void sgpp::quadrature::SampleGenerator::setDimensions | ( | size_t | dimensions | ) |
Sets the number of dimensions for sample generation to the given value.
dimensions | new number of dimensions |
References dimensions.
Referenced by getSample().
|
protected |
Referenced by getDimensions(), sgpp::quadrature::HaltonSampleGenerator::getSample(), sgpp::quadrature::StratifiedSampleGenerator::getSample(), sgpp::quadrature::LatinHypercubeSampleGenerator::getSample(), getSamples(), sgpp::quadrature::HaltonSampleGenerator::HaltonSampleGenerator(), sgpp::quadrature::LatinHypercubeSampleGenerator::LatinHypercubeSampleGenerator(), setDimensions(), and sgpp::quadrature::StratifiedSampleGenerator::StratifiedSampleGenerator().
|
protected |
|
protected |