patchPSPP - Patches: patch #5872, Misc cleanup for categorical...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #5872: Misc cleanup for categorical values.

Submitter:  John Darrington <jmd>
Submitted:  Wed 18 Apr 2007 10:21:49 AM UTC
   
 
Category:  None Item Group:  None
Status:  Done Assigned to:  None
Open/Closed:  Closed

Sun 22 Apr 2007 12:50:52 AM UTC, comment #4: 

Thanks.  I've committed this now.

John Darrington <jmd>
Group administrator
Sat 21 Apr 2007 03:26:16 PM UTC, comment #3: 

Looks good and works for me.

Jason H Stover <jstover>
Group Member
Fri 20 Apr 2007 11:23:05 AM UTC, comment #2: 

OK.  How about this version?


(file #12534)

John Darrington <jmd>
Group administrator
Wed 18 Apr 2007 03:54:33 PM UTC, comment #1: 

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 *obs_vals->vals);
      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.

Jason H Stover <jstover>
Group Member
Wed 18 Apr 2007 10:21:49 AM UTC, original submission:  

I'm trying to get my head around the regression/design-matrix/categorical-values stuff.

I suggest applying this patch, which encapsulates the cat_vals struct better, and tidies up a few other things too.

John Darrington <jmd>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #12534:  cat2.patch added by jmd (16KiB - text/x-diff)
file #12517:  cat.patch added by jmd (14KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jstover (Posted a comment)
  • -email is unavailable- added by jmd (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-04-22 jmd StatusReady For Test/Review Done
        Assigned tojmd None
        Open/ClosedOpen Closed
    2007-04-21 jstover Assigned tojstover jmd
    2007-04-20 jmd Attached File- Added cat2.patch, #12534
    2007-04-18 jmd Attached File- Added cat.patch, #12517

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code