[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #5872] Misc cleanup for categorical values.

From: Jason H Stover
Subject: [patch #5872] Misc cleanup for categorical values.
Date: Wed, 18 Apr 2007 15:54:34 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20060909 Firefox/

Follow-up Comment #1, patch #5872 (project pspp):

It works and seems fine for the tests I ran. I have two concerns: In
category.c, this code: 

if (!var_has_obs_vals (v))
      struct cat_vals *obs_vals = xmalloc (sizeof *obs_vals);
      obs_vals->n_categories = 0;
      obs_vals->n_allocated_categories = N_INITIAL_CATEGORIES;
      obs_vals->vals = xnmalloc (N_INITIAL_CATEGORIES, sizeof
      var_set_obs_vals (v, obs_vals);

was mean to prevent a procedure from re-creating those binary vectors if they
had already been created by another procedure. By removing the 'if' statement,
and moving the call var_set_obs_vals() to regression.q, no such checking
occurs, so any procedure will end up re-creating the binary vectors, unless
that procedure checks for them itself. I put the checking in category.c so
the procedures wouldn't have to be that smart.

The second, minor concern is that cat_vector_to_value() might be necessary
later. But since it isn't necessary now, dropping it wouldn't hurt, since we
could replace easily it if necessary.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]