Commit e0319699 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

New function. Remove.

2002-05-03  Morten Welinder  <terra@diku.dk>

	* src/rangefunc.c (range_count): New function.
	* src/func-util.h: Remove.


2002-05-03  Morten Welinder  <terra@diku.dk>

	* fn-database.c: Major cleanup.

	* fn-stat.c: Make more things static and remove dependency on
	func-util.h.
parent 9c3ff4d9
2002-05-03 Morten Welinder <terra@diku.dk>
* src/rangefunc.c (range_count): New function.
* src/func-util.h: Remove.
2002-05-02 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/print-info.c (print_info_free) : add print-config
......
......@@ -9,6 +9,10 @@ Jody
* Fix drawing glitch when creating unshared views not at A1
* Copy freeze state and outline info
Morten:
* Cleanup fn-database.
* Disentangle fn-stat and fn-database.
--------------------------------------------------------------------------
Gnumeric 1.1.3
......
2002-05-03 Morten Welinder <terra@diku.dk>
* src/rangefunc.c (range_count): New function.
* src/func-util.h: Remove.
2002-05-02 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/print-info.c (print_info_free) : add print-config
......
2002-05-03 Morten Welinder <terra@diku.dk>
* src/rangefunc.c (range_count): New function.
* src/func-util.h: Remove.
2002-05-02 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/print-info.c (print_info_free) : add print-config
......
This diff is collapsed.
......@@ -25,7 +25,6 @@
#include <gnumeric.h>
#include <func.h>
#include <func-util.h>
#include <parse-util.h>
#include <mathfunc.h>
#include <rangefunc.h>
......@@ -55,7 +54,13 @@ float_compare (const gnum_float *a, const gnum_float *b)
return 1;
}
void
typedef struct {
int N;
gnum_float M, Q, sum;
gboolean afun_flag;
} stat_closure_t;
static void
setup_stat_closure (stat_closure_t *cl)
{
cl->N = 0;
......@@ -65,34 +70,7 @@ setup_stat_closure (stat_closure_t *cl)
cl->sum = 0.0;
}
/**
* FIXME : this is also a kludge, but at least it is more localized
* than before. We should not have to do this
*/
static Value *
stat_helper (stat_closure_t *cl, EvalPos const *ep, Value *val)
{
GnmExprConstant expr;
GnmExprList *expr_node_list;
Value *err;
setup_stat_closure (cl);
gnm_expr_constant_init (&expr, val);
expr_node_list = gnm_expr_list_append (NULL, &expr);
err = function_iterate_argument_values (ep,
&callback_function_stat, cl, expr_node_list,
TRUE, FALSE);
gnm_expr_list_free (expr_node_list);
if (err != NULL)
return err;
if (cl->N <= 1)
return value_new_error (ep, gnumeric_err_VALUE);
return NULL;
}
Value *
callback_function_stat (EvalPos const *ep, Value *value, void *closure)
{
stat_closure_t *mm = closure;
......@@ -121,6 +99,33 @@ callback_function_stat (EvalPos const *ep, Value *value, void *closure)
return NULL;
}
/**
* FIXME : this is also a kludge, but at least it is more localized
* than before. We should not have to do this
*/
static Value *
stat_helper (stat_closure_t *cl, EvalPos const *ep, Value *val)
{
GnmExprConstant expr;
GnmExprList *expr_node_list;
Value *err;
setup_stat_closure (cl);
gnm_expr_constant_init (&expr, val);
expr_node_list = gnm_expr_list_append (NULL, &expr);
err = function_iterate_argument_values (ep,
&callback_function_stat, cl, expr_node_list,
TRUE, FALSE);
gnm_expr_list_free (expr_node_list);
if (err != NULL)
return err;
if (cl->N <= 1)
return value_new_error (ep, gnumeric_err_VALUE);
return NULL;
}
typedef struct {
GSList *entries;
int n;
......
......@@ -94,7 +94,6 @@ GNUMERIC_BASE = \
func.h \
func-builtin.c \
func-builtin.h \
func-util.h \
format.c \
format.h \
global-gnome-font.c \
......
......@@ -231,7 +231,7 @@ deserialize_wb_from_xml_stream (StreamIOCtxt *sc, IOContext *ioc,
return gnumeric_io_error_occurred (ioc) ? -1 : 0;
}
static int
static void
read_from_stream (StreamDeserializer sdeserializer, Bonobo_Stream stream,
IOContext *ioc, WorkbookView *wb_view,
CORBA_Environment *ev)
......
#ifndef GNUMERIC_FUNC_UTIL_H
#define GNUMERIC_FUNC_UTIL_H
#include "numbers.h"
typedef struct {
int N;
gnum_float M, Q, sum;
gboolean afun_flag;
} stat_closure_t;
void setup_stat_closure (stat_closure_t *cl);
Value *callback_function_stat (EvalPos const *ep, Value *value,
void *closure);
#endif /* GNUMERIC_FUNC_UTIL_H */
2002-05-03 Morten Welinder <terra@diku.dk>
* fn-database.c: Major cleanup.
* fn-stat.c: Make more things static and remove dependency on
func-util.h.
2002-04-29 Jody Goldberg <jody@gnome.org>
* Release 1.1.3
......
This diff is collapsed.
......@@ -25,7 +25,6 @@
#include <gnumeric.h>
#include <func.h>
#include <func-util.h>
#include <parse-util.h>
#include <mathfunc.h>
#include <rangefunc.h>
......@@ -55,7 +54,13 @@ float_compare (const gnum_float *a, const gnum_float *b)
return 1;
}
void
typedef struct {
int N;
gnum_float M, Q, sum;
gboolean afun_flag;
} stat_closure_t;
static void
setup_stat_closure (stat_closure_t *cl)
{
cl->N = 0;
......@@ -65,34 +70,7 @@ setup_stat_closure (stat_closure_t *cl)
cl->sum = 0.0;
}
/**
* FIXME : this is also a kludge, but at least it is more localized
* than before. We should not have to do this
*/
static Value *
stat_helper (stat_closure_t *cl, EvalPos const *ep, Value *val)
{
GnmExprConstant expr;
GnmExprList *expr_node_list;
Value *err;
setup_stat_closure (cl);
gnm_expr_constant_init (&expr, val);
expr_node_list = gnm_expr_list_append (NULL, &expr);
err = function_iterate_argument_values (ep,
&callback_function_stat, cl, expr_node_list,
TRUE, FALSE);
gnm_expr_list_free (expr_node_list);
if (err != NULL)
return err;
if (cl->N <= 1)
return value_new_error (ep, gnumeric_err_VALUE);
return NULL;
}
Value *
callback_function_stat (EvalPos const *ep, Value *value, void *closure)
{
stat_closure_t *mm = closure;
......@@ -121,6 +99,33 @@ callback_function_stat (EvalPos const *ep, Value *value, void *closure)
return NULL;
}
/**
* FIXME : this is also a kludge, but at least it is more localized
* than before. We should not have to do this
*/
static Value *
stat_helper (stat_closure_t *cl, EvalPos const *ep, Value *val)
{
GnmExprConstant expr;
GnmExprList *expr_node_list;
Value *err;
setup_stat_closure (cl);
gnm_expr_constant_init (&expr, val);
expr_node_list = gnm_expr_list_append (NULL, &expr);
err = function_iterate_argument_values (ep,
&callback_function_stat, cl, expr_node_list,
TRUE, FALSE);
gnm_expr_list_free (expr_node_list);
if (err != NULL)
return err;
if (cl->N <= 1)
return value_new_error (ep, gnumeric_err_VALUE);
return NULL;
}
typedef struct {
GSList *entries;
int n;
......
......@@ -15,6 +15,14 @@
#include <stdlib.h>
#include <string.h>
int
range_count (const gnum_float *xs, int n, gnum_float *res)
{
*res = n;
return 0;
}
/* Arithmetic sum. */
/* We are using the double pass algorithm 2.3.1 described in */
/* Thisted: Elements of Statistical Computing */
......
......@@ -3,6 +3,8 @@
#include "numbers.h"
int range_count (const gnum_float *xs, int n, gnum_float *res);
int range_sum (const gnum_float *xs, int n, gnum_float *res);
int range_product (const gnum_float *xs, int n, gnum_float *res);
int range_multinomial (const gnum_float *xs, int n, gnum_float *res);
......
......@@ -5,7 +5,7 @@
#include <gal/util/e-util.h>
static char *
wbcc_get_password (CommandContext *cc, char const* msg) {}
wbcc_get_password (CommandContext *cc, char const* msg) { return NULL; }
static void
wbcc_progress_set (CommandContext *cc, gfloat val) {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment