/[pspp]/pspp/src/descript.c
ViewVC logotype

Diff of /pspp/src/descript.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by blp, Wed Oct 26 05:06:14 2005 UTC revision 1.18 by blp, Thu Nov 3 06:21:46 2005 UTC
# Line 68  struct dsc_z_score Line 68  struct dsc_z_score
68  /* DESCRIPTIVES transformation (for calculating Z-scores). */  /* DESCRIPTIVES transformation (for calculating Z-scores). */
69  struct dsc_trns  struct dsc_trns
70    {    {
     struct trns_header h;  
71      struct dsc_z_score *z_scores; /* Array of Z-scores. */      struct dsc_z_score *z_scores; /* Array of Z-scores. */
72      int z_score_cnt;            /* Number of Z-scores. */      int z_score_cnt;            /* Number of Z-scores. */
73      struct variable **vars;     /* Variables for listwise missing checks. */      struct variable **vars;     /* Variables for listwise missing checks. */
# Line 569  dump_z_table (struct dsc_proc *dsc) Line 568  dump_z_table (struct dsc_proc *dsc)
568     (either system or user-missing values that weren't included).     (either system or user-missing values that weren't included).
569  */  */
570  static int  static int
571  descriptives_trns_proc (struct trns_header *trns, struct ccase * c,  descriptives_trns_proc (void *trns_, struct ccase * c,
572                          int case_idx UNUSED)                          int case_idx UNUSED)
573  {  {
574    struct dsc_trns *t = (struct dsc_trns *) trns;    struct dsc_trns *t = trns_;
575    struct dsc_z_score *z;    struct dsc_z_score *z;
576    struct variable **vars;    struct variable **vars;
577    int all_sysmis = 0;    int all_sysmis = 0;
# Line 611  descriptives_trns_proc (struct trns_head Line 610  descriptives_trns_proc (struct trns_head
610    
611  /* Frees a descriptives_trns struct. */  /* Frees a descriptives_trns struct. */
612  static void  static void
613  descriptives_trns_free (struct trns_header * trns)  descriptives_trns_free (void *trns_)
614  {  {
615    struct dsc_trns *t = (struct dsc_trns *) trns;    struct dsc_trns *t = trns_;
616    
617    free (t->z_scores);    free (t->z_scores);
618    assert((t->missing_type != DSC_LISTWISE) ^ (t->vars != NULL));    assert((t->missing_type != DSC_LISTWISE) ^ (t->vars != NULL));
# Line 632  setup_z_trns (struct dsc_proc *dsc) Line 631  setup_z_trns (struct dsc_proc *dsc)
631        cnt++;        cnt++;
632    
633    t = xmalloc (sizeof *t);    t = xmalloc (sizeof *t);
   t->h.proc = descriptives_trns_proc;  
   t->h.free = descriptives_trns_free;  
634    t->z_scores = xnmalloc (cnt, sizeof *t->z_scores);    t->z_scores = xnmalloc (cnt, sizeof *t->z_scores);
635    t->z_score_cnt = cnt;    t->z_score_cnt = cnt;
636    t->missing_type = dsc->missing_type;    t->missing_type = dsc->missing_type;
# Line 650  setup_z_trns (struct dsc_proc *dsc) Line 647  setup_z_trns (struct dsc_proc *dsc)
647        t->var_cnt = 0;        t->var_cnt = 0;
648        t->vars = NULL;        t->vars = NULL;
649      }      }
     
650    
651    for (cnt = i = 0; i < dsc->var_cnt; i++)    for (cnt = i = 0; i < dsc->var_cnt; i++)
652      {      {
# Line 685  setup_z_trns (struct dsc_proc *dsc) Line 681  setup_z_trns (struct dsc_proc *dsc)
681          }          }
682      }      }
683    
684    add_transformation ((struct trns_header *) t);    add_transformation (descriptives_trns_proc, descriptives_trns_free, t);
685  }  }
686    
687  /* Statistical calculation. */  /* Statistical calculation. */

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26