[apps/probability] Comments to explain the 0.001 precision is proba

Change-Id: Id5618802f9a08967b2fa0d68b35ff2a4f0b5a116
This commit is contained in:
Émilie Feral
2017-02-13 14:11:06 +01:00
parent 82f29ea2e4
commit 761be1c8c7
5 changed files with 5 additions and 3 deletions

View File

@@ -17,6 +17,9 @@ public:
virtual float lowerBound();
virtual float upperBound();
protected:
/* Parameters in probability application are rounded to 3 decimals. This is
* due to the limited precision of some calculation (e. g. standard normal
* cumulative distributive function or inverse). */
constexpr static float k_precision = 0.001f;
virtual void compute(int indexKnownElement) = 0;
Law * m_law;

View File

@@ -32,7 +32,6 @@ const char * FiniteIntegralCalculation::legendForParameterAtIndex(int index) {
void FiniteIntegralCalculation::setParameterAtIndex(float f, int index) {
assert(index >= 0 && index < 3);
/* Parameters in probability application are rounder to 3 decimals */
float rf = roundf(f/k_precision)*k_precision;
if (index == 0) {
m_lowerBound = rf;

View File

@@ -28,7 +28,6 @@ const char * LeftIntegralCalculation::legendForParameterAtIndex(int index) {
void LeftIntegralCalculation::setParameterAtIndex(float f, int index) {
assert(index >= 0 && index < 2);
/* Parameters in probability application are rounder to 3 decimals */
float rf = roundf(f/k_precision)*k_precision;
if (index == 0) {
m_upperBound = rf;

View File

@@ -28,7 +28,6 @@ const char * RightIntegralCalculation::legendForParameterAtIndex(int index) {
void RightIntegralCalculation::setParameterAtIndex(float f, int index) {
assert(index >= 0 && index < 2);
/* Parameters in probability application are rounder to 3 decimals */
float rf = roundf(f/k_precision)*k_precision;
if (index == 0) {
m_lowerBound = rf;