projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
math: Make 'accumulate' a feature of order statistics, not all stats.
[pspp]
/
src
/
output
/
charts
/
np-plot.c
diff --git
a/src/output/charts/np-plot.c
b/src/output/charts/np-plot.c
index e912479a72bbd0bceca65079a1bfc3c098522c80..eeffbc1fa1d5f0cf3beae266974f1f95dd89bd25 100644
(file)
--- a/
src/output/charts/np-plot.c
+++ b/
src/output/charts/np-plot.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2004, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2008, 2009
, 2011
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-16,28
+16,26
@@
#include <config.h>
#include <config.h>
-#include
<output/charts/np-plot.h>
+#include
"output/charts/np-plot.h"
#include <gsl/gsl_cdf.h>
#include <gsl/gsl_cdf.h>
-#include
<data/casereader.h>
-#include
<libpspp/cast.h>
-#include
<math/np.h>
-#include
<output/chart-item-provider.h>
+#include
"data/casereader.h"
+#include
"libpspp/cast.h"
+#include
"math/np.h"
+#include
"output/chart-provider.h"
#include "gl/minmax.h"
#include "gl/minmax.h"
-static struct chart
_item
*
+static struct chart *
make_np_plot (const struct np *np, const struct casereader *reader,
const char *label, bool detrended)
{
make_np_plot (const struct np *np, const struct casereader *reader,
const char *label, bool detrended)
{
- struct np_plot_chart *npp;
-
- if (np->n < 1.0)
+ if (np->n <= 1.0)
return NULL;
return NULL;
-
npp = xmalloc (sizeof *npp
);
- chart_i
tem_init (&npp->chart_item
, &np_plot_chart_class, label);
+
struct np_plot_chart *npp = XZALLOC (struct np_plot_chart
);
+ chart_i
nit (&npp->chart
, &np_plot_chart_class, label);
npp->data = casereader_clone (reader);
npp->y_min = np->y_min;
npp->y_max = np->y_max;
npp->data = casereader_clone (reader);
npp->y_min = np->y_min;
npp->y_max = np->y_max;
@@
-58,7
+56,7
@@
make_np_plot (const struct np *np, const struct casereader *reader,
npp->x_upper = MAX (np->y_max, (npp->y_last - npp->intercept) / npp->slope);
npp->slack = (npp->x_upper - npp->x_lower) * 0.05;
npp->x_upper = MAX (np->y_max, (npp->y_last - npp->intercept) / npp->slope);
npp->slack = (npp->x_upper - npp->x_lower) * 0.05;
- return &npp->chart
_item
;
+ return &npp->chart;
}
/* Creates and returns a normal probability plot corresponding to
}
/* Creates and returns a normal probability plot corresponding to
@@
-69,7
+67,7
@@
make_np_plot (const struct np *np, const struct casereader *reader,
Returns a null pointer if the data set is empty.
The caller retains ownership of NP and READER. */
Returns a null pointer if the data set is empty.
The caller retains ownership of NP and READER. */
-struct chart
_item
*
+struct chart *
np_plot_create (const struct np *np, const struct casereader *reader,
const char *label)
{
np_plot_create (const struct np *np, const struct casereader *reader,
const char *label)
{
@@
-85,7
+83,7
@@
np_plot_create (const struct np *np, const struct casereader *reader,
Returns a null pointer if the data set is empty.
The caller retains ownership of NP and READER. */
Returns a null pointer if the data set is empty.
The caller retains ownership of NP and READER. */
-struct chart
_item
*
+struct chart *
dnp_plot_create (const struct np *np, const struct casereader *reader,
const char *label)
{
dnp_plot_create (const struct np *np, const struct casereader *reader,
const char *label)
{
@@
-93,15
+91,14
@@
dnp_plot_create (const struct np *np, const struct casereader *reader,
}
static void
}
static void
-np_plot_chart_destroy (struct chart
_item *chart_item
)
+np_plot_chart_destroy (struct chart
*chart
)
{
{
- struct np_plot_chart *npp = to_np_plot_chart (chart
_item
);
+ struct np_plot_chart *npp = to_np_plot_chart (chart);
casereader_destroy (npp->data);
casereader_destroy (npp->data);
- free (npp->label);
free (npp);
}
free (npp);
}
-const struct chart_
item_
class np_plot_chart_class =
+const struct chart_class np_plot_chart_class =
{
np_plot_chart_destroy
};
{
np_plot_chart_destroy
};