Update Spanish translation
[gnumeric.git] / src / tools / random-generator.h
blob20d9843cee19eca30ed42d2f43667068667235fd
1 #ifndef GNUMERIC_RANDOM_GENERATOR_H
2 #define GNUMERIC_RANDOM_GENERATOR_H
4 #include <gnumeric.h>
5 #include <numbers.h>
6 #include <tools/dao.h>
7 #include <tools/tools.h>
10 typedef enum {
11 DiscreteDistribution, UniformDistribution, NormalDistribution,
12 BernoulliDistribution, BetaDistribution, BinomialDistribution,
13 PoissonDistribution, CauchyDistribution, ChisqDistribution, GammaDistribution,
14 WeibullDistribution, FdistDistribution, GeometricDistribution,
15 Gumbel1Distribution, Gumbel2Distribution, LaplaceDistribution,
16 TdistDistribution, LogarithmicDistribution, LogisticDistribution,
17 ParetoDistribution, LognormalDistribution, RayleighDistribution,
18 LevyDistribution, ExponentialPowerDistribution, RayleighTailDistribution,
19 LandauDistribution, GaussianTailDistribution, UniformIntDistribution,
20 /* PatternedDistribution, */ NegativeBinomialDistribution, ExponentialDistribution
21 } random_distribution_t;
23 typedef struct {
24 GnmValue *range;
25 } discrete_random_tool_t;
27 typedef struct {
28 gnm_float lower_limit;
29 gnm_float upper_limit;
30 } uniform_random_tool_t;
32 typedef struct {
33 gnm_float mean;
34 gnm_float stdev;
35 } normal_random_tool_t;
37 typedef struct {
38 gnm_float p;
39 } bernoulli_random_tool_t;
41 typedef struct {
42 gnm_float a;
43 gnm_float b;
44 } beta_random_tool_t;
46 typedef struct {
47 gnm_float p;
48 int trials;
49 } binomial_random_tool_t;
51 typedef struct {
52 gnm_float p;
53 int f;
54 } negbinom_random_tool_t;
56 typedef struct {
57 gnm_float lambda;
58 } poisson_random_tool_t;
60 typedef struct {
61 gnm_float b;
62 } exponential_random_tool_t;
64 typedef struct {
65 gnm_float a;
66 gnm_float b;
67 } exppow_random_tool_t;
69 typedef struct {
70 gnm_float a;
71 } cauchy_random_tool_t;
73 typedef struct {
74 gnm_float nu;
75 } chisq_random_tool_t;
77 typedef struct {
78 gnm_float zeta;
79 gnm_float sigma;
80 } lognormal_random_tool_t;
82 typedef struct {
83 gnm_float sigma;
84 } rayleigh_random_tool_t;
86 typedef struct {
87 gnm_float a;
88 gnm_float sigma;
89 } rayleigh_tail_random_tool_t;
91 typedef struct {
92 gnm_float c;
93 gnm_float alpha;
94 } levy_random_tool_t;
96 typedef struct {
97 gnm_float nu1;
98 gnm_float nu2;
99 } fdist_random_tool_t;
101 typedef struct {
102 gnm_float nu;
103 } tdist_random_tool_t;
105 typedef struct {
106 gnm_float p;
107 } logarithmic_random_tool_t;
109 typedef struct {
110 gnm_float a;
111 gnm_float b;
112 } pareto_random_tool_t;
114 typedef struct {
115 gnm_float a;
116 } logistic_random_tool_t;
118 typedef struct {
119 gnm_float a;
120 gnm_float b;
121 } gamma_random_tool_t;
123 typedef struct {
124 gnm_float a;
125 gnm_float b;
126 } weibull_random_tool_t;
128 typedef struct {
129 gnm_float a;
130 } laplace_random_tool_t;
132 typedef struct {
133 gnm_float a;
134 gnm_float sigma;
135 } gaussian_tail_random_tool_t;
137 typedef struct {
138 gnm_float a;
139 gnm_float b;
140 } gumbel_random_tool_t;
142 typedef struct {
143 gnm_float p;
144 } geometric_random_tool_t;
146 /* typedef struct { */
147 /* gnm_float from, to; */
148 /* gnm_float step; */
149 /* int repeat_number; */
150 /* int repeat_sequence; */
151 /* } patterned_random_tool_t; */
153 typedef union {
154 discrete_random_tool_t discrete;
155 uniform_random_tool_t uniform;
156 normal_random_tool_t normal;
157 bernoulli_random_tool_t bernoulli;
158 beta_random_tool_t beta;
159 binomial_random_tool_t binomial;
160 negbinom_random_tool_t negbinom;
161 poisson_random_tool_t poisson;
162 exponential_random_tool_t exponential;
163 exppow_random_tool_t exppow;
164 cauchy_random_tool_t cauchy;
165 chisq_random_tool_t chisq;
166 lognormal_random_tool_t lognormal;
167 rayleigh_random_tool_t rayleigh;
168 rayleigh_tail_random_tool_t rayleigh_tail;
169 fdist_random_tool_t fdist;
170 tdist_random_tool_t tdist;
171 logarithmic_random_tool_t logarithmic;
172 logistic_random_tool_t logistic;
173 levy_random_tool_t levy;
174 pareto_random_tool_t pareto;
175 gamma_random_tool_t gamma;
176 geometric_random_tool_t geometric;
177 gumbel_random_tool_t gumbel;
178 laplace_random_tool_t laplace;
179 gaussian_tail_random_tool_t gaussian_tail;
180 weibull_random_tool_t weibull;
181 /* patterned_random_tool_t patterned; */
182 } random_tool_t;
184 typedef struct {
185 random_tool_t param;
186 WorkbookControl *wbc;
187 gint n_vars;
188 gint count;
189 random_distribution_t distribution;
190 } tools_data_random_t;
192 gboolean tool_random_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
193 analysis_tool_engine_t selector, gpointer result);
195 #endif