[apps/prbability] Use special char for parameter names

Change-Id: I9c4c64021f6a2366a5f993f13d28dce194600132
This commit is contained in:
Émilie Feral
2017-01-31 12:12:53 +01:00
parent b37688745e
commit 7a2ec6ebfc
3 changed files with 11 additions and 5 deletions

View File

@@ -25,7 +25,8 @@ bool ExponentialLaw::isContinuous() const {
const char * ExponentialLaw::parameterNameAtIndex(int index) {
assert(index == 0);
return "l";
constexpr static char name[] = {Ion::Charset::SmallLambda, 0};
return name;
}
const char * ExponentialLaw::parameterDefinitionAtIndex(int index) {

View File

@@ -26,9 +26,11 @@ bool NormalLaw::isContinuous() const {
const char * NormalLaw::parameterNameAtIndex(int index) {
assert(index >= 0 && index < 2);
if (index == 0) {
return "u";
constexpr static char meanName[] = {Ion::Charset::SmallMu, 0};
return meanName;
} else {
return "o";
constexpr static char devName[] = {Ion::Charset::SmallSigma, 0};
return devName;
}
}

View File

@@ -1,6 +1,7 @@
#include "poisson_law.h"
#include <assert.h>
#include <math.h>
#include <ion.h>
namespace Probability {
@@ -23,12 +24,14 @@ bool PoissonLaw::isContinuous() const {
const char * PoissonLaw::parameterNameAtIndex(int index) {
assert(index == 0);
return "l";
constexpr static char name[] = {Ion::Charset::SmallLambda, 0};
return name;
}
const char * PoissonLaw::parameterDefinitionAtIndex(int index) {
assert(index == 0);
return "l : parametre";
constexpr static char meanDef[] = {Ion::Charset::SmallLambda, ' ', ':', ' ', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'r', 'e', 0};
return meanDef;
}
float PoissonLaw::xMin() {