25 #ifndef OPAL_SAMPLE_GAUSSIAN_SEQUENCE_H
26 #define OPAL_SAMPLE_GAUSSIAN_SEQUENCE_H
31 #ifdef WITH_UNIT_TESTS
32 #include <gtest/gtest_prod.h>
44 double mean = 0.5 * (lower + upper);
45 double sigma = (upper - lower) / 10;
46 double factor = sigma /
sqrt(2);
47 double dx = 2.0 / nSample;
48 for (
long i = 0; i < nSample; ++ i) {
49 double x = -1.0 + (i + 0.5) * dx;
55 void create(boost::shared_ptr<SampleIndividual>& ind,
size_t i) {
56 ind->genes[i] =
getNext(ind->id);
67 #ifdef WITH_UNIT_TESTS
68 FRIEND_TEST(GaussianSampleTest, ChainTest);
Tps< T > sqrt(const Tps< T > &x)
Square root.
std::vector< double > sampleChain_m
unsigned int numSamples_m
SampleGaussianSequence(double lower, double upper, size_t modulo, int nSample)
void create(boost::shared_ptr< SampleIndividual > &ind, size_t i)
double getNext(unsigned int id)
size_t volumeLowerDimensions_m