From 3a03132c6c26837108b9743cbc063ac260a3f803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 22 Aug 2019 16:56:29 +0200 Subject: [PATCH] [apps/toolbox] Probability submenu --- apps/math_toolbox.cpp | 18 ++++++++++++++++++ apps/probability/base.de.i18n | 2 -- apps/probability/base.en.i18n | 2 -- apps/probability/base.es.i18n | 2 -- apps/probability/base.fr.i18n | 2 -- apps/probability/base.pt.i18n | 2 -- apps/shared.universal.i18n | 7 +++++++ apps/toolbox.de.i18n | 10 ++++++++++ apps/toolbox.en.i18n | 10 ++++++++++ apps/toolbox.es.i18n | 10 ++++++++++ apps/toolbox.fr.i18n | 10 ++++++++++ apps/toolbox.pt.i18n | 10 ++++++++++ 12 files changed, 75 insertions(+), 10 deletions(-) diff --git a/apps/math_toolbox.cpp b/apps/math_toolbox.cpp index 52576bec7..2bd9dc25d 100644 --- a/apps/math_toolbox.cpp +++ b/apps/math_toolbox.cpp @@ -29,6 +29,23 @@ const ToolboxMessageTree combinatoricsChildren[] = { ToolboxMessageTree::Leaf(I18n::Message::PermuteCommandWithArg, I18n::Message::Permutation) }; +const ToolboxMessageTree normalDistributionChildren[] = { + ToolboxMessageTree::Leaf(I18n::Message::NormCDFCommandWithArg, I18n::Message::NormCDF), + ToolboxMessageTree::Leaf(I18n::Message::NormCDF2CommandWithArg, I18n::Message::NormCDF2), + ToolboxMessageTree::Leaf(I18n::Message::InvNormCommandWithArg, I18n::Message::InvNorm), + ToolboxMessageTree::Leaf(I18n::Message::NormPDFCommandWithArg, I18n::Message::NormPDF) +}; + +const ToolboxMessageTree binomialDistributionChildren[] = { + ToolboxMessageTree::Leaf(I18n::Message::BinomialFDPCommandWithArg, I18n::Message::BinomialFDP), + ToolboxMessageTree::Leaf(I18n::Message::BinomialCDFCommandWithArg, I18n::Message::BinomialCDF), + ToolboxMessageTree::Leaf(I18n::Message::InvBinomialCommandWithArg, I18n::Message::InvBinomial), +}; + +const ToolboxMessageTree probabilityChildren[] = { + ToolboxMessageTree::Node(I18n::Message::NormalDistribution, normalDistributionChildren), + ToolboxMessageTree::Node(I18n::Message::BinomialDistribution, binomialDistributionChildren)}; + const ToolboxMessageTree arithmeticChildren[] = { ToolboxMessageTree::Leaf(I18n::Message::GcdCommandWithArg, I18n::Message::GreatCommonDivisor), ToolboxMessageTree::Leaf(I18n::Message::LcmCommandWithArg, I18n::Message::LeastCommonMultiple), @@ -85,6 +102,7 @@ const ToolboxMessageTree menu[] = { ToolboxMessageTree::Node(I18n::Message::Calculation, calculChildren), ToolboxMessageTree::Node(I18n::Message::ComplexNumber, complexChildren), ToolboxMessageTree::Node(I18n::Message::Combinatorics, combinatoricsChildren), + ToolboxMessageTree::Node(I18n::Message::Probability, probabilityChildren), ToolboxMessageTree::Node(I18n::Message::Arithmetic, arithmeticChildren), ToolboxMessageTree::Node(I18n::Message::Matrices, matricesChildren), #if LIST_ARE_DEFINED diff --git a/apps/probability/base.de.i18n b/apps/probability/base.de.i18n index 1a5a599c8..caad4c2e7 100644 --- a/apps/probability/base.de.i18n +++ b/apps/probability/base.de.i18n @@ -8,11 +8,9 @@ Normal = "Normal" Poisson = "Poisson" ChiSquared = "Chi-Quadrat" Student = "Student" -BinomialDistribution = "Binomialverteilung" UniformDistribution = "Uniformverteilung" ExponentialDistribution = "Exponentialverteilung" GeometricDistribution = "Geometrischeverteilung" -NormalDistribution = "Normalverteilung" PoissonDistribution = "Poisson-Verteilung" ChiSquaredDistribution = "Chi-Quadrat-Verteilung" StudentDistribution = "Student-Verteilung" diff --git a/apps/probability/base.en.i18n b/apps/probability/base.en.i18n index 8a95a3ac0..275bfef05 100644 --- a/apps/probability/base.en.i18n +++ b/apps/probability/base.en.i18n @@ -8,11 +8,9 @@ Normal = "Normal" Poisson = "Poisson" ChiSquared = "Chi-squared" Student = "Student" -BinomialDistribution = "Binomial distribution" UniformDistribution = "Uniform distribution" ExponentialDistribution = "Exponential distribution" GeometricDistribution = "Geometric distribution" -NormalDistribution = "Normal distribution" PoissonDistribution = "Poisson distribution" ChiSquaredDistribution = "Chi-squared distribution" StudentDistribution = "Student's distribution" diff --git a/apps/probability/base.es.i18n b/apps/probability/base.es.i18n index 87f5f8e05..608daf6f5 100644 --- a/apps/probability/base.es.i18n +++ b/apps/probability/base.es.i18n @@ -8,11 +8,9 @@ Normal = "Normal" Poisson = "Poisson" ChiSquared = "Chi-cuadrado" Student = "Student" -BinomialDistribution = "Distribución binomial" UniformDistribution = "Distribución uniforme" ExponentialDistribution = "Distribución exponencial" GeometricDistribution = "Distribución geométrica" -NormalDistribution = "Distribución normal" PoissonDistribution = "Distribución de Poisson" ChiSquaredDistribution = "Distribución chi-cuadrado" StudentDistribution = "Distribución de Student" diff --git a/apps/probability/base.fr.i18n b/apps/probability/base.fr.i18n index 74af267e8..0e14134eb 100644 --- a/apps/probability/base.fr.i18n +++ b/apps/probability/base.fr.i18n @@ -8,11 +8,9 @@ Normal = "Normale" Poisson = "Poisson" ChiSquared = "Chi2" Student = "Student" -BinomialDistribution = "Loi binomiale" UniformDistribution = "Loi uniforme" ExponentialDistribution = "Loi exponentielle" GeometricDistribution = "Loi géométrique" -NormalDistribution = "Loi normale" PoissonDistribution = "Loi de Poisson" ChiSquaredDistribution = "Loi du chi2" StudentDistribution = "Loi de Student" diff --git a/apps/probability/base.pt.i18n b/apps/probability/base.pt.i18n index 21290a404..35ced259c 100644 --- a/apps/probability/base.pt.i18n +++ b/apps/probability/base.pt.i18n @@ -8,11 +8,9 @@ Normal = "Normal" Poisson = "Poisson" ChiSquared = "Qui-quadrado" Student = "Student" -BinomialDistribution = "Distribuição binomial" UniformDistribution = "Distribuição uniforme" ExponentialDistribution = "Distribuição exponencial" GeometricDistribution = "Distribuição geométrica" -NormalDistribution = "Distribuição normal" PoissonDistribution = "Distribuição de Poisson" ChiSquaredDistribution = "Distribuição qui-quadrado" StudentDistribution = "Distribuição de Student" diff --git a/apps/shared.universal.i18n b/apps/shared.universal.i18n index 53f463a65..517bfb638 100644 --- a/apps/shared.universal.i18n +++ b/apps/shared.universal.i18n @@ -8,6 +8,8 @@ AsinhCommandWithArg = "asinh(x)" AtanhCommandWithArg = "atanh(x)" B = "b" BinomialCommandWithArg = "binomial(n,k)" +BinomialCDFCommandWithArg = "binomcdf(m,n,p)" +BinomialFDPCommandWithArg = "binomfdp(m,n,p)" BlankMessage = " " C = "c" CapitalAlpha = "ALPHA" @@ -33,7 +35,9 @@ ImCommandWithArg = "im(z)" IndentityCommandWithArg = "identity(n)" IntCommand = "int(\x11,x,\x11,\x11)" IntCommandWithArg = "int(f(x),x,a,b)" +InvBinomialCommandWithArg = "invbinom(a,n,p)" InverseCommandWithArg = "inverse(M)" +InvNormCommandWithArg = "invnorm(a,μ,var)" InvSortCommandWithArg = "sort>(L)" K = "k" Lambda = "λ" @@ -46,6 +50,9 @@ MaxCommandWithArg = "max(L)" MinCommandWithArg = "min(L)" Mu = "μ" N = "n" +NormCDFCommandWithArg = "normcdf(a,μ,var)" +NormCDF2CommandWithArg = "normcdf2(a,b,μ,var)" +NormPDFCommandWithArg = "normpdf(x,μ,var)" PermuteCommandWithArg = "permute(n,r)" P = "p" Prediction95CommandWithArg = "prediction95(p,n)" diff --git a/apps/toolbox.de.i18n b/apps/toolbox.de.i18n index a3431768a..715f1b0e8 100644 --- a/apps/toolbox.de.i18n +++ b/apps/toolbox.de.i18n @@ -53,3 +53,13 @@ RandomAndApproximation = "Zufall und Näherung" RandomFloat = "Dezimalzahl in [0,1]" RandomInteger = "Zufällige ganze Zahl in [a,b]" PrimeFactorDecomposition = "Primfaktorzerlegung" +NormCDF = "P(X