Files
Upsilon/apps/probability/calculation/calculation.h
Émilie Feral f0a776a670 [apps] Operations in double when precision required
Change-Id: I7168a861a76178f0bf81841e9378f7399f67914a
2017-08-17 09:31:53 +02:00

39 lines
1.0 KiB
C++

#ifndef PROBABILITE_CALCULATION_H
#define PROBABILITE_CALCULATION_H
#include "../law/law.h"
namespace Probability {
class Calculation {
public:
enum class Type : uint8_t{
LeftIntegral,
FiniteIntegral,
RightIntegral,
Discrete,
};
Calculation();
virtual ~Calculation() = default;
virtual Type type() = 0;
void setLaw(Law * law);
virtual int numberOfParameters() = 0;
virtual int numberOfEditableParameters();
virtual I18n::Message legendForParameterAtIndex(int index) = 0;
virtual void setParameterAtIndex(double f, int index) = 0;
virtual double parameterAtIndex(int index) = 0;
virtual double lowerBound();
virtual double 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 double k_precision = 0.001;
virtual void compute(int indexKnownElement) = 0;
Law * m_law;
};
}
#endif