+
+Mon Jan 31 09:52:51 WST 2005 John Darrington <john@darrington.wattle.id.au>
+
+ * examine.q factor_stats.c oneway.q output.c pfm-read.c: Fixed some
+ problems revealed by valgrind.
+
+
Wed Jan 26 11:44:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
* set.q: Affixed a fix to the previous fix such that we'll be OK now
}
+/* Create a hash table of percentiles and their values from the list of
+ percentiles */
static struct hsh_table *
list_to_ptile_hash(const subc_list_double *l)
{
struct percentile *p = xmalloc (sizeof (struct percentile));
p->p = subc_list_double_at(l,i);
+ p->v = SYSMIS;
hsh_insert(h, p);
assert(p);
+
tab_float (tbl, col + 2,
row + 4,
TAB_CENTER,
p->v,
8, 2);
}
+
tab_text (tbl, col,
row + 5,
m->min = DBL_MAX;
m->max = -DBL_MAX;
+ m->histogram = 0;
m->moments = moments1_create(MOMENT_KURTOSIS);
m->wvp = (struct weighted_value **) hsh_sort(m->ordered_data);
m->n_data = hsh_count(m->ordered_data);
+ /* Trimmed mean calculation */
+ if ( m->n_data <= 1 )
+ {
+ m->trimmed_mean = m->mean;
+ return;
+ }
+
m->histogram = histogram_create(10, m->min, m->max);
for ( i = 0 ; i < m->n_data ; ++i )
gsl_histogram_accumulate(m->histogram, wv[i]->v.f, wv[i]->w);
}
- /* Trimmed mean calculation */
- if ( m->n_data <= 1 )
- {
- m->trimmed_mean = m->mean;
- return;
- }
-
tc = m->n * 0.05 ;
k1 = -1;
k2 = -1;
{
hsh_destroy(m->ordered_data);
hsh_destroy(m->ptile_hash);
- gsl_histogram_free(m->histogram);
+ if ( m-> histogram )
+ gsl_histogram_free(m->histogram);
}
void
multipass_procedure_with_splits (run_oneway, &cmd);
- free_oneway(&cmd);
+ free (vars);
+ free_oneway (&cmd);
return CMD_SUCCESS;
}
free(n);
n = next;
}
+ free (outp_title);
+ free (outp_subtitle);
return 1;
}
return 0;
}
+static unsigned char * read_string (struct pfm_reader *r);
+
/* Closes a portable file after we're done with it. */
void
pfm_close_reader (struct pfm_reader *r)
if (r == NULL)
return;
+ read_string (NULL);
+
if (r->fh != NULL)
fh_close (r->fh, "portable file", "rs");
if (fclose (r->file) == EOF)