Files
Upsilon/apps/probability/distribution/one_parameter_distribution.h
Arthur Camouseigt 018dd91ca1 [Probability] Changed distribution parameter's type to double
Plots are still rendered in float but computations are now in double

Change-Id: I7e0a38effb780861b1443ee92a097cd319de3bc8
2020-11-04 14:45:35 +01:00

28 lines
628 B
C++

#ifndef PROBABILITE_ONE_PARAMETER_DISTRIBUTION_H
#define PROBABILITE_ONE_PARAMETER_DISTRIBUTION_H
#include "distribution.h"
#include <assert.h>
namespace Probability {
class OneParameterDistribution : public Distribution {
public:
OneParameterDistribution(float parameterValue) : m_parameter1(parameterValue) {}
int numberOfParameter() override { return 1; }
double parameterValueAtIndex(int index) override {
assert(index == 0);
return m_parameter1;
}
void setParameterAtIndex(float f, int index) override {
assert(index == 0);
m_parameter1 = f;
}
protected:
double m_parameter1;
};
}
#endif