1 #ifndef PMPL_POINT_CONSTRUCTION_H
2 #define PMPL_POINT_CONSTRUCTION_H
24 Vector<double, D> center, Vector<double, D> bounds);
28 Vector<double, D> center, Vector<double, D> bounds,
int nsamples);
32 Vector<double, D> center,
double bounds,
int nsamples);
40 Vector<double, D> ElementwiseMultiply(
41 Vector<double, D> a, Vector<double, D> b);
46 std::vector<Vector<double, D>>
50 for (
size_t i = 0; i<D; i++) { b[i] = bounds; }
51 Vector<double, D> _bounds(b);
57 std::vector<Vector<double, D>>
60 std::vector<Vector<double, D>> samples;
61 for (
int i = 0; i < nsamples; i++) {
76 double normal_samples[D];
77 for (
size_t i = 0; i < D; i++) {
80 Vector<double, D> samples(normal_samples);
82 std::cout <<
"Normal distribution sample: " << normal_samples << std::endl;
89 samples = samples.selfNormalize();
90 samples = ElementwiseMultiply(samples, bounds);
99 ElementwiseMultiply(Vector<double, D> a, Vector<double, D> b) {
100 Vector<double, D> multiplied;
101 for (
size_t i = 0; i < D; i++) {
102 multiplied[i] = a[i] * b[i];
double GaussianDistribution(double _mean, double _stdev)
Same as GRand, but one can specify the mean and stdev of the distribution.
Definition: MPUtils.cpp:44
Definition: MPBaseObject.h:46
bool m_debug
Print debug info?
Definition: MPBaseObject.h:183
Definition: PointConstruction.h:7
Vector< double, D > SampleSphereSurface(Vector< double, D > center, Vector< double, D > bounds)
Definition: PointConstruction.h:72
virtual void Initialize() override
Definition: PointConstruction.cpp:21
PointConstruction()
Definition: PointConstruction.cpp:8
double NormalDistribution(double mean, double variance)