[gnumeric] Provide progress feedback when generating random numbers.
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Provide progress feedback when generating random numbers.
- Date: Thu, 18 Aug 2011 18:34:11 +0000 (UTC)
commit 9ac2c2162860cc6d421b1a21bdebf27be0338ad9
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Thu Aug 18 12:33:11 2011 -0600
Provide progress feedback when generating random numbers.
2011-08-18 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/consolidate.c: add argument to tools engine
* src/consolidate.h: add argument to tools engine
* src/commands.c (cmd_analysis_tool_*): adjust calls to tools engine
2011-08-18 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/tools/*.c: add argument to tools engine
* src/tools/*.h: add argument to tools engine
* src/tools/random-generator.c: provide progress reporting when
calculating random numbers
ChangeLog | 6 +
NEWS | 1 +
src/commands.c | 20 ++-
src/consolidate.c | 2 +-
src/consolidate.h | 2 +-
src/tools/ChangeLog | 9 +-
src/tools/analysis-anova.c | 2 +-
src/tools/analysis-anova.h | 7 +-
src/tools/analysis-auto-expression.c | 2 +-
src/tools/analysis-auto-expression.h | 7 +-
src/tools/analysis-chi-squared.c | 2 +-
src/tools/analysis-chi-squared.h | 7 +-
src/tools/analysis-exp-smoothing.c | 2 +-
src/tools/analysis-exp-smoothing.h | 2 +-
src/tools/analysis-frequency.c | 2 +-
src/tools/analysis-frequency.h | 2 +-
src/tools/analysis-histogram.c | 2 +-
src/tools/analysis-histogram.h | 2 +-
src/tools/analysis-kaplan-meier.c | 2 +-
src/tools/analysis-kaplan-meier.h | 2 +-
src/tools/analysis-normality.c | 2 +-
src/tools/analysis-normality.h | 2 +-
src/tools/analysis-principal-components.c | 2 +-
src/tools/analysis-principal-components.h | 2 +-
src/tools/analysis-sign-test.c | 4 +-
src/tools/analysis-sign-test.h | 4 +-
src/tools/analysis-signed-rank-test.c | 4 +-
src/tools/analysis-signed-rank-test.h | 4 +-
src/tools/analysis-tools.c | 28 ++--
src/tools/analysis-tools.h | 40 +++--
src/tools/fill-series.c | 2 +-
src/tools/fill-series.h | 2 +-
src/tools/filter.c | 2 +-
src/tools/random-generator-cor.c | 2 +-
src/tools/random-generator-cor.h | 2 +-
src/tools/random-generator.c | 253 ++++++++++++++++++++---------
src/tools/random-generator.h | 2 +-
src/tools/tools.h | 3 +-
38 files changed, 291 insertions(+), 152 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c292d20..cd91306 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-18 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * src/consolidate.c: add argument to tools engine
+ * src/consolidate.h: add argument to tools engine
+ * src/commands.c (cmd_analysis_tool_*): adjust calls to tools engine
+
2011-08-17 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/rendered-value.h (_GnmRenderedValue): re-add color field
diff --git a/NEWS b/NEWS
index e651a2a..c8f81c2 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ Andreas:
* Provide xls file opener permitting encoding specification. [#535473]
* Fix writing of scatter style in xlsx export. [#656799]
* Provide progress feedback for xlsx import. [#634803]
+ * Provide progress feedback when generating random numbers.
Jean:
* Make things build against gtk+-3.0.
diff --git a/src/commands.c b/src/commands.c
index f01af98..6c8270d 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -5264,6 +5264,7 @@ cmd_analysis_tool_redo (GnmCommand *cmd, WorkbookControl *wbc)
{
gpointer continuity = NULL;
CmdAnalysis_Tool *me = CMD_ANALYSIS_TOOL (cmd);
+ GOCmdContext *cc = GO_CMD_CONTEXT (wbc);
g_return_val_if_fail (me != NULL, TRUE);
@@ -5274,11 +5275,11 @@ cmd_analysis_tool_redo (GnmCommand *cmd, WorkbookControl *wbc)
me->row_info = colrow_state_list_destroy (me->row_info);
me->row_info = dao_get_colrow_state_list (me->dao, FALSE);
- if (me->engine (me->dao, me->specs, TOOL_ENGINE_PREPARE_OUTPUT_RANGE, NULL)
- || me->engine (me->dao, me->specs, TOOL_ENGINE_UPDATE_DESCRIPTOR,
+ if (me->engine (cc, me->dao, me->specs, TOOL_ENGINE_PREPARE_OUTPUT_RANGE, NULL)
+ || me->engine (cc, me->dao, me->specs, TOOL_ENGINE_UPDATE_DESCRIPTOR,
&me->cmd.cmd_descriptor)
|| cmd_dao_is_locked_effective (me->dao, wbc, me->cmd.cmd_descriptor)
- || me->engine (me->dao, me->specs, TOOL_ENGINE_LAST_VALIDITY_CHECK, &continuity))
+ || me->engine (cc, me->dao, me->specs, TOOL_ENGINE_LAST_VALIDITY_CHECK, &continuity))
return TRUE;
switch (me->type) {
@@ -5301,10 +5302,10 @@ cmd_analysis_tool_redo (GnmCommand *cmd, WorkbookControl *wbc)
if (me->newSheetObjects != NULL)
dao_set_omit_so (me->dao, TRUE);
- if (me->engine (me->dao, me->specs, TOOL_ENGINE_FORMAT_OUTPUT_RANGE, NULL))
+ if (me->engine (cc, me->dao, me->specs, TOOL_ENGINE_FORMAT_OUTPUT_RANGE, NULL))
return TRUE;
- if (me->engine (me->dao, me->specs, TOOL_ENGINE_PERFORM_CALC, &continuity)) {
+ if (me->engine (cc, me->dao, me->specs, TOOL_ENGINE_PERFORM_CALC, &continuity)) {
if (me->type == RangeOutput) {
g_warning ("This is too late for failure! The target region has "
"already been formatted!");
@@ -5344,13 +5345,14 @@ static void
cmd_analysis_tool_finalize (GObject *cmd)
{
CmdAnalysis_Tool *me = CMD_ANALYSIS_TOOL (cmd);
+ GOCmdContext *cc = GO_CMD_CONTEXT (me->dao->wbc);
if (me->col_info)
me->col_info = colrow_state_list_destroy (me->col_info);
if (me->row_info)
me->row_info = colrow_state_list_destroy (me->row_info);
- me->engine (me->dao, me->specs, TOOL_ENGINE_CLEAN_UP, NULL);
+ me->engine (cc, me->dao, me->specs, TOOL_ENGINE_CLEAN_UP, NULL);
if (me->specs_owned) {
g_free (me->specs);
@@ -5375,6 +5377,7 @@ cmd_analysis_tool (WorkbookControl *wbc, G_GNUC_UNUSED Sheet *sheet,
{
CmdAnalysis_Tool *me;
gboolean trouble;
+ GOCmdContext *cc = GO_CMD_CONTEXT (wbc);
g_return_val_if_fail (dao != NULL, TRUE);
g_return_val_if_fail (specs != NULL, TRUE);
@@ -5390,11 +5393,12 @@ cmd_analysis_tool (WorkbookControl *wbc, G_GNUC_UNUSED Sheet *sheet,
me->dao = dao;
me->engine = engine;
me->cmd.cmd_descriptor = NULL;
- if (me->engine (me->dao, me->specs, TOOL_ENGINE_UPDATE_DAO, NULL)) {
+ if (me->engine (cc, me->dao, me->specs, TOOL_ENGINE_UPDATE_DAO, NULL)) {
g_object_unref (me);
return TRUE;
}
- me->engine (me->dao, me->specs, TOOL_ENGINE_UPDATE_DESCRIPTOR, &me->cmd.cmd_descriptor);
+ me->engine (cc, me->dao, me->specs, TOOL_ENGINE_UPDATE_DESCRIPTOR,
+ &me->cmd.cmd_descriptor);
me->cmd.sheet = NULL;
me->type = dao->type;
me->row_info = NULL;
diff --git a/src/consolidate.c b/src/consolidate.c
index abc9a54..f8353ef 100644
--- a/src/consolidate.c
+++ b/src/consolidate.c
@@ -741,7 +741,7 @@ consolidate_apply (GnmConsolidate *cs,
gboolean
-tool_consolidate_engine (data_analysis_output_t *dao, gpointer specs,
+tool_consolidate_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
GnmConsolidate *cs = specs;
diff --git a/src/consolidate.h b/src/consolidate.h
index 0935f37..c80bc28 100644
--- a/src/consolidate.h
+++ b/src/consolidate.h
@@ -50,7 +50,7 @@ gboolean consolidate_add_source (GnmConsolidate *cs, GnmValue *range);
gboolean consolidate_check_destination (GnmConsolidate *cs,
data_analysis_output_t *dao);
-gboolean tool_consolidate_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean tool_consolidate_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
G_END_DECLS
diff --git a/src/tools/ChangeLog b/src/tools/ChangeLog
index be0a7cd..c6efb31 100644
--- a/src/tools/ChangeLog
+++ b/src/tools/ChangeLog
@@ -1,3 +1,10 @@
+2011-08-18 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * src/tools/*.c: add argument to tools engine
+ * src/tools/*.h: add argument to tools engine
+ * src/tools/random-generator.c: provide progress reporting when
+ calculating random numbers
+
2011-07-31 Morten Welinder <terra gnome org>
* Release 1.10.17
@@ -17,7 +24,7 @@
2011-05-2 Andreas J. Guelzow <aguelzow pyrshep ca>
- * analysis-chi-squared.c (analysis_tool_chi_squared_engine_run):
+ * analysis-chi-squared.c (analysis_tool_chi_squared_engine_run):
no colons in field labels
* analysis-kaplan-meier.c (analysis_tool_kaplan_meier_engine_run): ditto
* analysis-principal-components.c
diff --git a/src/tools/analysis-anova.c b/src/tools/analysis-anova.c
index 52ce357..e9bccde 100644
--- a/src/tools/analysis-anova.c
+++ b/src/tools/analysis-anova.c
@@ -824,7 +824,7 @@ analysis_tool_anova_two_factor_engine_clean (G_GNUC_UNUSED data_analysis_output_
}
gboolean
-analysis_tool_anova_two_factor_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_anova_two_factor_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_anova_two_factor_t *info = specs;
diff --git a/src/tools/analysis-anova.h b/src/tools/analysis-anova.h
index 14cf4cb..18c4a86 100644
--- a/src/tools/analysis-anova.h
+++ b/src/tools/analysis-anova.h
@@ -49,8 +49,11 @@ typedef struct {
gint n_r;
} analysis_tools_data_anova_two_factor_t;
-gboolean analysis_tool_anova_two_factor_engine (data_analysis_output_t *dao, gpointer specs,
- analysis_tool_engine_t selector, gpointer result);
+gboolean analysis_tool_anova_two_factor_engine (GOCmdContext *gcc,
+ data_analysis_output_t *dao,
+ gpointer specs,
+ analysis_tool_engine_t selector,
+ gpointer result);
#endif
diff --git a/src/tools/analysis-auto-expression.c b/src/tools/analysis-auto-expression.c
index a956702..851a779 100644
--- a/src/tools/analysis-auto-expression.c
+++ b/src/tools/analysis-auto-expression.c
@@ -87,7 +87,7 @@ analysis_tool_auto_expression_engine_clean (gpointer specs)
}
gboolean
-analysis_tool_auto_expression_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_auto_expression_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_auto_expression_t *info = specs;
diff --git a/src/tools/analysis-auto-expression.h b/src/tools/analysis-auto-expression.h
index b079b38..9428814 100644
--- a/src/tools/analysis-auto-expression.h
+++ b/src/tools/analysis-auto-expression.h
@@ -41,7 +41,10 @@ typedef struct {
GnmFunc *func;
} analysis_tools_data_auto_expression_t;
-gboolean analysis_tool_auto_expression_engine (data_analysis_output_t *dao, gpointer specs,
- analysis_tool_engine_t selector, gpointer result);
+gboolean analysis_tool_auto_expression_engine (GOCmdContext *gcc,
+ data_analysis_output_t *dao,
+ gpointer specs,
+ analysis_tool_engine_t selector,
+ gpointer result);
#endif
diff --git a/src/tools/analysis-chi-squared.c b/src/tools/analysis-chi-squared.c
index 6dfda49..da8d4c4 100644
--- a/src/tools/analysis-chi-squared.c
+++ b/src/tools/analysis-chi-squared.c
@@ -165,7 +165,7 @@ analysis_tool_chi_squared_clean (gpointer specs)
gboolean
-analysis_tool_chi_squared_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_chi_squared_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_chi_squared_t *info = specs;
diff --git a/src/tools/analysis-chi-squared.h b/src/tools/analysis-chi-squared.h
index 75b42b9..b7dae5a 100644
--- a/src/tools/analysis-chi-squared.h
+++ b/src/tools/analysis-chi-squared.h
@@ -44,8 +44,11 @@ typedef struct {
gint n_r;
} analysis_tools_data_chi_squared_t;
-gboolean analysis_tool_chi_squared_engine (data_analysis_output_t *dao, gpointer specs,
- analysis_tool_engine_t selector, gpointer result);
+gboolean analysis_tool_chi_squared_engine (GOCmdContext *gcc,
+ data_analysis_output_t *dao,
+ gpointer specs,
+ analysis_tool_engine_t selector,
+ gpointer result);
#endif
diff --git a/src/tools/analysis-exp-smoothing.c b/src/tools/analysis-exp-smoothing.c
index 0b25b80..b9d15f2 100644
--- a/src/tools/analysis-exp-smoothing.c
+++ b/src/tools/analysis-exp-smoothing.c
@@ -1356,7 +1356,7 @@ analysis_tool_exponential_smoothing_engine_mtes_run (data_analysis_output_t *dao
}
gboolean
-analysis_tool_exponential_smoothing_engine (data_analysis_output_t *dao,
+analysis_tool_exponential_smoothing_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao,
gpointer specs,
analysis_tool_engine_t selector,
gpointer result)
diff --git a/src/tools/analysis-exp-smoothing.h b/src/tools/analysis-exp-smoothing.h
index 15d907a..641bc9d 100644
--- a/src/tools/analysis-exp-smoothing.h
+++ b/src/tools/analysis-exp-smoothing.h
@@ -55,7 +55,7 @@ typedef struct {
exponential_smoothing_type_t es_type;
} analysis_tools_data_exponential_smoothing_t;
-gboolean analysis_tool_exponential_smoothing_engine (data_analysis_output_t *dao,
+gboolean analysis_tool_exponential_smoothing_engine (GOCmdContext *gcc, data_analysis_output_t *dao,
gpointer specs,
analysis_tool_engine_t selector,
gpointer result);
diff --git a/src/tools/analysis-frequency.c b/src/tools/analysis-frequency.c
index 2a357e6..2edee00 100644
--- a/src/tools/analysis-frequency.c
+++ b/src/tools/analysis-frequency.c
@@ -260,7 +260,7 @@ calc_length (GnmValue *bin)
gboolean
-analysis_tool_frequency_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_frequency_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_frequency_t *info = specs;
diff --git a/src/tools/analysis-frequency.h b/src/tools/analysis-frequency.h
index 2c8da06..3878a87 100644
--- a/src/tools/analysis-frequency.h
+++ b/src/tools/analysis-frequency.h
@@ -52,7 +52,7 @@ typedef struct {
chart_freq_t chart;
} analysis_tools_data_frequency_t;
-gboolean analysis_tool_frequency_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_frequency_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
#endif
diff --git a/src/tools/analysis-histogram.c b/src/tools/analysis-histogram.c
index 63cf042..e7ed338 100644
--- a/src/tools/analysis-histogram.c
+++ b/src/tools/analysis-histogram.c
@@ -436,7 +436,7 @@ calc_length (GnmValue *bin)
}
gboolean
-analysis_tool_histogram_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_histogram_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_histogram_t *info = specs;
diff --git a/src/tools/analysis-histogram.h b/src/tools/analysis-histogram.h
index 1c747a5..8ee30bf 100644
--- a/src/tools/analysis-histogram.h
+++ b/src/tools/analysis-histogram.h
@@ -70,7 +70,7 @@ typedef struct {
chart_t chart;
} analysis_tools_data_histogram_t;
-gboolean analysis_tool_histogram_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_histogram_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
#endif
diff --git a/src/tools/analysis-kaplan-meier.c b/src/tools/analysis-kaplan-meier.c
index 8840a0f..1a8a2db 100644
--- a/src/tools/analysis-kaplan-meier.c
+++ b/src/tools/analysis-kaplan-meier.c
@@ -644,7 +644,7 @@ analysis_tool_kaplan_meier_clear_gl_cb (gpointer data, G_GNUC_UNUSED gpointer us
}
gboolean
-analysis_tool_kaplan_meier_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_kaplan_meier_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_kaplan_meier_t *info = specs;
diff --git a/src/tools/analysis-kaplan-meier.h b/src/tools/analysis-kaplan-meier.h
index dbcda61..fee71b9 100644
--- a/src/tools/analysis-kaplan-meier.h
+++ b/src/tools/analysis-kaplan-meier.h
@@ -63,7 +63,7 @@ typedef struct {
} analysis_tools_kaplan_meier_group_t;
-gboolean analysis_tool_kaplan_meier_engine (data_analysis_output_t *dao,
+gboolean analysis_tool_kaplan_meier_engine (GOCmdContext *gcc, data_analysis_output_t *dao,
gpointer specs,
analysis_tool_engine_t selector,
gpointer result);
diff --git a/src/tools/analysis-normality.c b/src/tools/analysis-normality.c
index e96b2d4..77ecb55 100644
--- a/src/tools/analysis-normality.c
+++ b/src/tools/analysis-normality.c
@@ -184,7 +184,7 @@ analysis_tool_normality_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_normality_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_normality_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_normality_t *info = specs;
diff --git a/src/tools/analysis-normality.h b/src/tools/analysis-normality.h
index 67e09f2..e127d6d 100644
--- a/src/tools/analysis-normality.h
+++ b/src/tools/analysis-normality.h
@@ -49,7 +49,7 @@ typedef struct {
gboolean graph;
} analysis_tools_data_normality_t;
-gboolean analysis_tool_normality_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_normality_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
diff --git a/src/tools/analysis-principal-components.c b/src/tools/analysis-principal-components.c
index 56e42da..b25c071 100644
--- a/src/tools/analysis-principal-components.c
+++ b/src/tools/analysis-principal-components.c
@@ -210,7 +210,7 @@ analysis_tool_principal_components_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_principal_components_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_principal_components_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_generic_t *info = specs;
diff --git a/src/tools/analysis-principal-components.h b/src/tools/analysis-principal-components.h
index 9458335..4d7bcba 100644
--- a/src/tools/analysis-principal-components.h
+++ b/src/tools/analysis-principal-components.h
@@ -34,7 +34,7 @@
#include "analysis-tools.h"
#include "sheet.h"
-gboolean analysis_tool_principal_components_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_principal_components_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
diff --git a/src/tools/analysis-sign-test.c b/src/tools/analysis-sign-test.c
index 32c6ca1..f34c918 100644
--- a/src/tools/analysis-sign-test.c
+++ b/src/tools/analysis-sign-test.c
@@ -342,7 +342,7 @@ analysis_tool_sign_test_two_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_sign_test_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_sign_test_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_sign_test_t *info = specs;
@@ -373,7 +373,7 @@ analysis_tool_sign_test_engine (data_analysis_output_t *dao, gpointer specs,
}
gboolean
-analysis_tool_sign_test_two_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_sign_test_two_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
switch (selector) {
diff --git a/src/tools/analysis-sign-test.h b/src/tools/analysis-sign-test.h
index c032dc8..6188949 100644
--- a/src/tools/analysis-sign-test.h
+++ b/src/tools/analysis-sign-test.h
@@ -45,10 +45,10 @@ typedef struct {
gnm_float median;
} analysis_tools_data_sign_test_two_t;
-gboolean analysis_tool_sign_test_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_sign_test_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
-gboolean analysis_tool_sign_test_two_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_sign_test_two_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
#endif
diff --git a/src/tools/analysis-signed-rank-test.c b/src/tools/analysis-signed-rank-test.c
index bfad0b8..1c7d519 100644
--- a/src/tools/analysis-signed-rank-test.c
+++ b/src/tools/analysis-signed-rank-test.c
@@ -528,7 +528,7 @@ analysis_tool_signed_rank_test_two_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_signed_rank_test_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_signed_rank_test_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_sign_test_t *info = specs;
@@ -559,7 +559,7 @@ analysis_tool_signed_rank_test_engine (data_analysis_output_t *dao, gpointer spe
}
gboolean
-analysis_tool_signed_rank_test_two_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_signed_rank_test_two_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
switch (selector) {
diff --git a/src/tools/analysis-signed-rank-test.h b/src/tools/analysis-signed-rank-test.h
index bb0de58..9d0cf54 100644
--- a/src/tools/analysis-signed-rank-test.h
+++ b/src/tools/analysis-signed-rank-test.h
@@ -37,14 +37,14 @@
/* note: specs is a pointer to a analysis_tools_data_sign_test_t */
-gboolean analysis_tool_signed_rank_test_engine (data_analysis_output_t *dao,
+gboolean analysis_tool_signed_rank_test_engine (GOCmdContext *gcc, data_analysis_output_t *dao,
gpointer specs,
analysis_tool_engine_t selector,
gpointer result);
/* note: specs is a pointer to a analysis_tools_data_sign_test_two_t */
-gboolean analysis_tool_signed_rank_test_two_engine (data_analysis_output_t *dao,
+gboolean analysis_tool_signed_rank_test_two_engine (GOCmdContext *gcc, data_analysis_output_t *dao,
gpointer specs,
analysis_tool_engine_t selector,
gpointer result);
diff --git a/src/tools/analysis-tools.c b/src/tools/analysis-tools.c
index 2244f9f..423aaf5 100644
--- a/src/tools/analysis-tools.c
+++ b/src/tools/analysis-tools.c
@@ -671,7 +671,7 @@ analysis_tool_correlation_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_correlation_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_correlation_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_generic_t *info = specs;
@@ -726,7 +726,7 @@ analysis_tool_covariance_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_covariance_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_covariance_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_generic_t *info = specs;
@@ -1117,7 +1117,7 @@ analysis_tool_descriptive_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_descriptive_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_descriptive_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_descriptive_t *info = specs;
@@ -1312,7 +1312,7 @@ analysis_tool_sampling_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_sampling_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_sampling_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_sampling_t *info = specs;
@@ -1579,7 +1579,7 @@ analysis_tool_ztest_engine_run (data_analysis_output_t *dao,
gboolean
-analysis_tool_ztest_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_ztest_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
switch (selector) {
@@ -1870,7 +1870,7 @@ analysis_tool_ttest_paired_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_ttest_paired_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_ttest_paired_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector,
gpointer result)
{
@@ -2171,7 +2171,7 @@ analysis_tool_ttest_eqvar_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_ttest_eqvar_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_ttest_eqvar_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
switch (selector) {
@@ -2464,7 +2464,7 @@ analysis_tool_ttest_neqvar_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_ttest_neqvar_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_ttest_neqvar_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
switch (selector) {
@@ -2752,7 +2752,7 @@ analysis_tool_ftest_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_ftest_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_ftest_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
switch (selector) {
@@ -3589,7 +3589,7 @@ analysis_tool_regression_simple_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_regression_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_regression_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_regression_t *info = specs;
@@ -4004,7 +4004,7 @@ analysis_tool_moving_average_engine_run (data_analysis_output_t *dao,
gboolean
-analysis_tool_moving_average_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_moving_average_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_moving_average_t *info = specs;
@@ -4167,7 +4167,7 @@ analysis_tool_ranking_engine_run (data_analysis_output_t *dao,
}
gboolean
-analysis_tool_ranking_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_ranking_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_ranking_t *info = specs;
@@ -4504,7 +4504,7 @@ finish_anova_single_factor_tool:
gboolean
-analysis_tool_anova_single_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_anova_single_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_anova_single_t *info = specs;
@@ -4607,7 +4607,7 @@ analysis_tool_fourier_calc_length (analysis_tools_data_fourier_t *info)
gboolean
-analysis_tool_fourier_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_fourier_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_fourier_t *info = specs;
diff --git a/src/tools/analysis-tools.h b/src/tools/analysis-tools.h
index fce511c..cb92f51 100644
--- a/src/tools/analysis-tools.h
+++ b/src/tools/analysis-tools.h
@@ -39,14 +39,20 @@ typedef struct {
/**************** Correlation Tool ***************/
-gboolean analysis_tool_correlation_engine (data_analysis_output_t *dao, gpointer specs,
- analysis_tool_engine_t selector, gpointer result);
+gboolean analysis_tool_correlation_engine (GOCmdContext *gcc,
+ data_analysis_output_t *dao,
+ gpointer specs,
+ analysis_tool_engine_t selector,
+ gpointer result);
/**************** Covariance Tool ***************/
-gboolean analysis_tool_covariance_engine (data_analysis_output_t *dao, gpointer specs,
- analysis_tool_engine_t selector, gpointer result);
+gboolean analysis_tool_covariance_engine (GOCmdContext *gcc,
+ data_analysis_output_t *dao,
+ gpointer specs,
+ analysis_tool_engine_t selector,
+ gpointer result);
/********************************************************************/
@@ -60,7 +66,7 @@ typedef struct {
gnm_float alpha;
} analysis_tools_data_anova_single_t;
-gboolean analysis_tool_anova_single_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_anova_single_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
/********** Descriptive Statistics Tool **********/
@@ -77,7 +83,7 @@ typedef struct {
gnm_float c_level;
} analysis_tools_data_descriptive_t;
-gboolean analysis_tool_descriptive_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_descriptive_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
@@ -101,7 +107,7 @@ typedef struct {
moving_average_type_t ma_type;
} analysis_tools_data_moving_average_t;
-gboolean analysis_tool_moving_average_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_moving_average_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
@@ -112,7 +118,7 @@ typedef struct {
gboolean inverse;
} analysis_tools_data_fourier_t;
-gboolean analysis_tool_fourier_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_fourier_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
@@ -128,7 +134,7 @@ typedef struct {
guint number;
} analysis_tools_data_sampling_t;
-gboolean analysis_tool_sampling_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_sampling_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
@@ -139,7 +145,7 @@ typedef struct {
gboolean av_ties;
} analysis_tools_data_ranking_t;
-gboolean analysis_tool_ranking_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_ranking_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
@@ -160,7 +166,7 @@ typedef struct {
gnm_float alpha;
} analysis_tools_data_generic_b_t;
-gboolean analysis_tool_ftest_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_ftest_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
/**************** Regression ********************/
@@ -175,7 +181,7 @@ typedef struct {
GSList *indep_vars;
} analysis_tools_data_regression_t;
-gboolean analysis_tool_regression_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_regression_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
/*********************** TTest paired *****************/
@@ -186,25 +192,25 @@ typedef struct {
gnm_float var2;
} analysis_tools_data_ttests_t;
-gboolean analysis_tool_ttest_paired_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_ttest_paired_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
/*********************** TTest equal variances *********/
-gboolean analysis_tool_ttest_eqvar_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_ttest_eqvar_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
/*********************** TTest unequal variances *******/
-gboolean analysis_tool_ttest_neqvar_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_ttest_neqvar_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
/*********************** ZTest ************************/
-gboolean analysis_tool_ztest_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_ztest_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
/**************** Advanced Filter ********************/
@@ -214,7 +220,7 @@ typedef struct {
gboolean unique_only_flag;
} analysis_tools_data_advanced_filter_t;
-gboolean analysis_tool_advanced_filter_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean analysis_tool_advanced_filter_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
diff --git a/src/tools/fill-series.c b/src/tools/fill-series.c
index b03d82b..834e5c9 100644
--- a/src/tools/fill-series.c
+++ b/src/tools/fill-series.c
@@ -368,7 +368,7 @@ fill_series_adjust_variables (data_analysis_output_t *dao, fill_series_t *info)
info->n = length_of_series;
}
-gboolean fill_series_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean fill_series_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
fill_series_t *info = specs;
diff --git a/src/tools/fill-series.h b/src/tools/fill-series.h
index 975fe46..51a1bf4 100644
--- a/src/tools/fill-series.h
+++ b/src/tools/fill-series.h
@@ -27,7 +27,7 @@ typedef struct {
gint n;
} fill_series_t;
-gboolean fill_series_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean fill_series_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
#endif
diff --git a/src/tools/filter.c b/src/tools/filter.c
index cd2e789..2108d63 100644
--- a/src/tools/filter.c
+++ b/src/tools/filter.c
@@ -260,7 +260,7 @@ finish:
gboolean
-analysis_tool_advanced_filter_engine (data_analysis_output_t *dao, gpointer specs,
+analysis_tool_advanced_filter_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
analysis_tools_data_advanced_filter_t *info = specs;
diff --git a/src/tools/random-generator-cor.c b/src/tools/random-generator-cor.c
index 870c0df..5aca93a 100644
--- a/src/tools/random-generator-cor.c
+++ b/src/tools/random-generator-cor.c
@@ -132,7 +132,7 @@ tool_random_cor_clean (gpointer specs)
gboolean
-tool_random_cor_engine (data_analysis_output_t *dao, gpointer specs,
+tool_random_cor_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
tools_data_random_cor_t *data = specs;
diff --git a/src/tools/random-generator-cor.h b/src/tools/random-generator-cor.h
index e4c0934..38dff9a 100644
--- a/src/tools/random-generator-cor.h
+++ b/src/tools/random-generator-cor.h
@@ -19,7 +19,7 @@ typedef struct {
gint variables;
} tools_data_random_cor_t;
-gboolean tool_random_cor_engine (data_analysis_output_t *dao,
+gboolean tool_random_cor_engine (GOCmdContext *gcc, data_analysis_output_t *dao,
gpointer specs,
analysis_tool_engine_t selector,
gpointer result);
diff --git a/src/tools/random-generator.c b/src/tools/random-generator.c
index e1d462a..544bbef 100644
--- a/src/tools/random-generator.c
+++ b/src/tools/random-generator.c
@@ -1,3 +1,4 @@
+/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* random-generator.c:
*
@@ -46,6 +47,18 @@
#include <string.h>
#include <math.h>
+#define PROGRESS_START int pro = 0; \
+ double total = info->n_vars * info->count; \
+ go_cmd_context_progress_set (gcc, 0); \
+ go_cmd_context_progress_message_set (gcc, _("Generating Random Numbers..."))
+#define PROGESS_RUN if ((++pro & 2047) == 0) { \
+ go_cmd_context_progress_set (gcc, pro/total); \
+ while (gtk_events_pending ()) \
+ gtk_main_iteration_do (FALSE); \
+ }
+#define PROGESS_END go_cmd_context_progress_set (gcc, 0); \
+ go_cmd_context_progress_message_set (gcc, NULL)
+
/************* Random Number Generation Tool ******************************
*
@@ -97,24 +110,24 @@ tool_random_engine_run_discrete_last_check (G_GNUC_UNUSED data_analysis_output_t
GnmValue *v;
gnm_float thisprob;
GnmCell *cell = sheet_cell_get (range->v_range.cell.a.sheet,
- range->v_range.cell.a.col + 1, i);
+ range->v_range.cell.a.col + 1, i);
if (cell == NULL ||
(v = cell->value) == NULL ||
!VALUE_IS_NUMBER (v)) {
gnm_cmd_context_error_calc (GO_CMD_CONTEXT (info->wbc),
- _("The probability input range "
- "contains a non-numeric value.\n"
- "All probabilities must be "
- "non-negative numbers."));
+ _("The probability input range "
+ "contains a non-numeric value.\n"
+ "All probabilities must be "
+ "non-negative numbers."));
goto random_tool_discrete_out;
}
if ((thisprob = value_get_as_float (v)) < 0) {
gnm_cmd_context_error_calc (GO_CMD_CONTEXT (info->wbc),
- _("The probability input range "
- "contains a negative number.\n"
- "All probabilities must be "
- "non-negative!"));
+ _("The probability input range "
+ "contains a negative number.\n"
+ "All probabilities must be "
+ "non-negative!"));
goto random_tool_discrete_out;
}
@@ -126,8 +139,8 @@ tool_random_engine_run_discrete_last_check (G_GNUC_UNUSED data_analysis_output_t
if (cell == NULL || cell->value == NULL) {
gnm_cmd_context_error_calc (GO_CMD_CONTEXT (info->wbc),
- _("None of the values in the value "
- "range may be empty!"));
+ _("None of the values in the value "
+ "range may be empty!"));
goto random_tool_discrete_out;
}
@@ -142,7 +155,7 @@ tool_random_engine_run_discrete_last_check (G_GNUC_UNUSED data_analysis_output_t
return FALSE;
}
gnm_cmd_context_error_calc (GO_CMD_CONTEXT (info->wbc),
- _("The probabilities may not all be 0!"));
+ _("The probabilities may not all be 0!"));
random_tool_discrete_out:
tool_random_engine_run_discrete_clear_continuity (continuity);
@@ -150,7 +163,7 @@ tool_random_engine_run_discrete_last_check (G_GNUC_UNUSED data_analysis_output_t
}
static gboolean
-tool_random_engine_run_discrete (data_analysis_output_t *dao,
+tool_random_engine_run_discrete (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
G_GNUC_UNUSED discrete_random_tool_t *param,
discrete_random_tool_local_t **continuity)
@@ -158,6 +171,7 @@ tool_random_engine_run_discrete (data_analysis_output_t *dao,
gint i;
discrete_random_tool_local_t *data = *continuity;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
int k;
for (k = 0; k < info->count; k++) {
@@ -169,32 +183,37 @@ tool_random_engine_run_discrete (data_analysis_output_t *dao,
dao_set_cell_value (dao, i, k,
value_dup (data->values[j]));
+ PROGESS_RUN;
}
}
tool_random_engine_run_discrete_clear_continuity (continuity);
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_uniform (data_analysis_output_t *dao,
+tool_random_engine_run_uniform (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
uniform_random_tool_t *param)
{
int i, n;
gnm_float range = param->upper_limit - param->lower_limit;
+
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = range * random_01 () + param->lower_limit;
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
-
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_uniform_int (data_analysis_output_t *dao,
+tool_random_engine_run_uniform_int (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
uniform_random_tool_t *param)
{
@@ -202,450 +221,536 @@ tool_random_engine_run_uniform_int (data_analysis_output_t *dao,
gnm_float lower = gnm_floor (param->lower_limit);
gnm_float range = gnm_floor (param->upper_limit) - lower;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = gnm_floor (0.5 + range * random_01 ()) + lower;
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_normal (data_analysis_output_t *dao,
+tool_random_engine_run_normal (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
normal_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = param->stdev * random_normal () + param->mean;
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_bernoulli (data_analysis_output_t *dao,
+tool_random_engine_run_bernoulli (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
bernoulli_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float tmp = random_bernoulli (param->p);
dao_set_cell_int (dao, i, n, (int)tmp);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_beta (data_analysis_output_t *dao,
+tool_random_engine_run_beta (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
beta_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float tmp = random_beta (param->a, param->b);
dao_set_cell_float (dao, i, n, tmp);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_binomial (data_analysis_output_t *dao,
+tool_random_engine_run_binomial (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
binomial_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_binomial (param->p,
param->trials);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_negbinom (data_analysis_output_t *dao,
+tool_random_engine_run_negbinom (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
negbinom_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_negbinom (param->p,
param->f);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_poisson (data_analysis_output_t *dao,
+tool_random_engine_run_poisson (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
poisson_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_poisson (param->lambda);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_exponential (data_analysis_output_t *dao,
+tool_random_engine_run_exponential (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
exponential_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_exponential (param->b);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_exppow (data_analysis_output_t *dao,
+tool_random_engine_run_exppow (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
exppow_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_exppow (param->a, param->b);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_cauchy (data_analysis_output_t *dao,
+tool_random_engine_run_cauchy (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
cauchy_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_cauchy (param->a);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_chisq (data_analysis_output_t *dao,
+tool_random_engine_run_chisq (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
chisq_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_chisq (param->nu);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_pareto (data_analysis_output_t *dao,
+tool_random_engine_run_pareto (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
pareto_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_pareto (param->a, param->b);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_rayleigh (data_analysis_output_t *dao,
+tool_random_engine_run_rayleigh (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
rayleigh_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_rayleigh (param->sigma);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_rayleigh_tail (data_analysis_output_t *dao,
+tool_random_engine_run_rayleigh_tail (GOCmdContext *gcc,
+ data_analysis_output_t *dao,
tools_data_random_t *info,
rayleigh_tail_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_rayleigh_tail (param->a, param->sigma);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_levy (data_analysis_output_t *dao,
+tool_random_engine_run_levy (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
levy_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_levy (param->c, param->alpha);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_fdist (data_analysis_output_t *dao,
+tool_random_engine_run_fdist (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
fdist_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_fdist (param->nu1, param->nu2);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_lognormal (data_analysis_output_t *dao,
+tool_random_engine_run_lognormal (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
lognormal_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_lognormal (param->zeta, param->sigma);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_logarithmic (data_analysis_output_t *dao,
+tool_random_engine_run_logarithmic (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
logarithmic_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_logarithmic (param->p);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_logistic (data_analysis_output_t *dao,
+tool_random_engine_run_logistic (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
logistic_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_logistic (param->a);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_tdist (data_analysis_output_t *dao,
+tool_random_engine_run_tdist (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
tdist_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_tdist (param->nu);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_gamma (data_analysis_output_t *dao,
+tool_random_engine_run_gamma (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
gamma_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_gamma (param->a, param->b);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_geometric (data_analysis_output_t *dao,
+tool_random_engine_run_geometric (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
geometric_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_geometric (param->p);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_weibull (data_analysis_output_t *dao,
+tool_random_engine_run_weibull (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
weibull_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_weibull (param->a, param->b);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_laplace (data_analysis_output_t *dao,
+tool_random_engine_run_laplace (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
laplace_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_laplace (param->a);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_gaussian_tail (data_analysis_output_t *dao,
+tool_random_engine_run_gaussian_tail (GOCmdContext *gcc,
+ data_analysis_output_t *dao,
tools_data_random_t *info,
gaussian_tail_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_gaussian_tail (param->a, param->sigma);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_landau (data_analysis_output_t *dao,
+tool_random_engine_run_landau (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_landau ();
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_gumbel1 (data_analysis_output_t *dao,
+tool_random_engine_run_gumbel1 (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
gumbel_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_gumbel1 (param->a, param->b);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
static gboolean
-tool_random_engine_run_gumbel2 (data_analysis_output_t *dao,
+tool_random_engine_run_gumbel2 (GOCmdContext *gcc, data_analysis_output_t *dao,
tools_data_random_t *info,
gumbel_random_tool_t *param)
{
int i, n;
+ PROGRESS_START;
for (i = 0; i < info->n_vars; i++) {
for (n = 0; n < info->count; n++) {
gnm_float v;
v = random_gumbel2 (param->a, param->b);
dao_set_cell_float (dao, i, n, v);
+ PROGESS_RUN;
}
}
+ PROGESS_END;
return FALSE;
}
gboolean
-tool_random_engine (data_analysis_output_t *dao, gpointer specs,
+tool_random_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
tools_data_random_t *info = specs;
@@ -679,94 +784,94 @@ tool_random_engine (data_analysis_output_t *dao, gpointer specs,
switch (info->distribution) {
case DiscreteDistribution:
return tool_random_engine_run_discrete
- (dao, specs, &info->param.discrete, result);
+ (gcc, dao, specs, &info->param.discrete, result);
case NormalDistribution:
return tool_random_engine_run_normal
- (dao, specs, &info->param.normal);
+ (gcc, dao, specs, &info->param.normal);
case BernoulliDistribution:
return tool_random_engine_run_bernoulli
- (dao, specs, &info->param.bernoulli);
+ (gcc, dao, specs, &info->param.bernoulli);
case BetaDistribution:
return tool_random_engine_run_beta
- (dao, specs, &info->param.beta);
+ (gcc, dao, specs, &info->param.beta);
case UniformDistribution:
return tool_random_engine_run_uniform
- (dao, specs, &info->param.uniform);
+ (gcc, dao, specs, &info->param.uniform);
case UniformIntDistribution:
return tool_random_engine_run_uniform_int
- (dao, specs, &info->param.uniform);
+ (gcc, dao, specs, &info->param.uniform);
case PoissonDistribution:
return tool_random_engine_run_poisson
- (dao, specs, &info->param.poisson);
+ (gcc, dao, specs, &info->param.poisson);
case ExponentialDistribution:
return tool_random_engine_run_exponential
- (dao, specs, &info->param.exponential);
+ (gcc, dao, specs, &info->param.exponential);
case ExponentialPowerDistribution:
return tool_random_engine_run_exppow
- (dao, specs, &info->param.exppow);
+ (gcc, dao, specs, &info->param.exppow);
case CauchyDistribution:
return tool_random_engine_run_cauchy
- (dao, specs, &info->param.cauchy);
+ (gcc, dao, specs, &info->param.cauchy);
case ChisqDistribution:
return tool_random_engine_run_chisq
- (dao, specs, &info->param.chisq);
+ (gcc, dao, specs, &info->param.chisq);
case ParetoDistribution:
return tool_random_engine_run_pareto
- (dao, specs, &info->param.pareto);
+ (gcc, dao, specs, &info->param.pareto);
case LognormalDistribution:
return tool_random_engine_run_lognormal
- (dao, specs, &info->param.lognormal);
+ (gcc, dao, specs, &info->param.lognormal);
case RayleighDistribution:
return tool_random_engine_run_rayleigh
- (dao, specs, &info->param.rayleigh);
+ (gcc, dao, specs, &info->param.rayleigh);
case RayleighTailDistribution:
return tool_random_engine_run_rayleigh_tail
- (dao, specs, &info->param.rayleigh_tail);
+ (gcc, dao, specs, &info->param.rayleigh_tail);
case LevyDistribution:
return tool_random_engine_run_levy
- (dao, specs, &info->param.levy);
+ (gcc, dao, specs, &info->param.levy);
case FdistDistribution:
return tool_random_engine_run_fdist
- (dao, specs, &info->param.fdist);
+ (gcc, dao, specs, &info->param.fdist);
case TdistDistribution:
return tool_random_engine_run_tdist
- (dao, specs, &info->param.tdist);
+ (gcc, dao, specs, &info->param.tdist);
case GammaDistribution:
return tool_random_engine_run_gamma
- (dao, specs, &info->param.gamma);
+ (gcc, dao, specs, &info->param.gamma);
case GeometricDistribution:
return tool_random_engine_run_geometric
- (dao, specs, &info->param.geometric);
+ (gcc, dao, specs, &info->param.geometric);
case WeibullDistribution:
return tool_random_engine_run_weibull
- (dao, specs, &info->param.weibull);
+ (gcc, dao, specs, &info->param.weibull);
case LaplaceDistribution:
return tool_random_engine_run_laplace
- (dao, specs, &info->param.laplace);
+ (gcc, dao, specs, &info->param.laplace);
case GaussianTailDistribution:
return tool_random_engine_run_gaussian_tail
- (dao, specs, &info->param.gaussian_tail);
+ (gcc, dao, specs, &info->param.gaussian_tail);
case LandauDistribution:
return tool_random_engine_run_landau
- (dao, specs);
+ (gcc, dao, specs);
case LogarithmicDistribution:
return tool_random_engine_run_logarithmic
- (dao, specs, &info->param.logarithmic);
+ (gcc, dao, specs, &info->param.logarithmic);
case LogisticDistribution:
return tool_random_engine_run_logistic
- (dao, specs, &info->param.logistic);
+ (gcc, dao, specs, &info->param.logistic);
case Gumbel1Distribution:
return tool_random_engine_run_gumbel1
- (dao, specs, &info->param.gumbel);
+ (gcc, dao, specs, &info->param.gumbel);
case Gumbel2Distribution:
return tool_random_engine_run_gumbel2
- (dao, specs, &info->param.gumbel);
+ (gcc, dao, specs, &info->param.gumbel);
case BinomialDistribution:
return tool_random_engine_run_binomial
- (dao, specs, &info->param.binomial);
+ (gcc, dao, specs, &info->param.binomial);
case NegativeBinomialDistribution:
return tool_random_engine_run_negbinom
- (dao, specs, &info->param.negbinom);
+ (gcc, dao, specs, &info->param.negbinom);
}
}
return TRUE; /* We shouldn't get here */
diff --git a/src/tools/random-generator.h b/src/tools/random-generator.h
index 91dfd5e..ca9170c 100644
--- a/src/tools/random-generator.h
+++ b/src/tools/random-generator.h
@@ -189,7 +189,7 @@ typedef struct {
random_distribution_t distribution;
} tools_data_random_t;
-gboolean tool_random_engine (data_analysis_output_t *dao, gpointer specs,
+gboolean tool_random_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
#endif
diff --git a/src/tools/tools.h b/src/tools/tools.h
index e552544..926f60d 100644
--- a/src/tools/tools.h
+++ b/src/tools/tools.h
@@ -30,7 +30,8 @@ typedef enum {
TOOL_ENGINE_CLEAN_UP
} analysis_tool_engine_t;
-typedef gboolean (* analysis_tool_engine) (data_analysis_output_t *dao, gpointer specs,
+typedef gboolean (* analysis_tool_engine) (GOCmdContext *gcc,
+ data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]