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

Diff of /pspp/src/cat.c

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

revision 1.3 by jstover, Thu Oct 13 19:25:01 2005 UTC revision 1.4 by jstover, Thu Oct 13 19:58:54 2005 UTC
# Line 65  cr_recoded_categorical_create (const str Line 65  cr_recoded_categorical_create (const str
65    rc->v = v;    rc->v = v;
66    rc->n_categories = 0;    rc->n_categories = 0;
67    rc->n_allocated_categories = N_INITIAL_CATEGORIES;    rc->n_allocated_categories = N_INITIAL_CATEGORIES;
68    rc->vals = xmalloc (N_INITIAL_CATEGORIES *    rc->vals = xmalloc (N_INITIAL_CATEGORIES * sizeof (*rc->vals));
                       sizeof (*rc->vals));  
69    
70    return rc;    return rc;
71  }  }
# Line 146  cr_value_update (struct recoded_categori Line 145  cr_value_update (struct recoded_categori
145        if (rc->n_categories >= rc->n_allocated_categories)        if (rc->n_categories >= rc->n_allocated_categories)
146          {          {
147            rc->n_allocated_categories *= 2;            rc->n_allocated_categories *= 2;
148            rc->vals =  xrealloc (rc->vals, rc->n_allocated_categories            rc->vals = xrealloc (rc->vals, rc->n_allocated_categories
149                                  * sizeof (*(rc->vals)));                                 * sizeof (*(rc->vals)));
150          }          }
151        rc->vals[rc->n_categories] = *v;        rc->vals[rc->n_categories] = *v;
152        rc->n_categories++;        rc->n_categories++;
# Line 221  cr_subscript_to_value (const size_t s, s Line 220  cr_subscript_to_value (const size_t s, s
220    to the value v.    to the value v.
221   */   */
222  static gsl_vector_view  static gsl_vector_view
223  cr_value_to_vector (const union value * v, struct recoded_categorical * cr)  cr_value_to_vector (const union value *v, struct recoded_categorical *cr)
224  {  {
225    size_t row;    size_t row;
226    row = cr_value_to_subscript (v, cr);    row = cr_value_to_subscript (v, cr);
# Line 415  design_matrix_col_to_var (const struct d Line 414  design_matrix_col_to_var (const struct d
414        dmv = dm->vars[i];        dmv = dm->vars[i];
415        if ((dmv.v)->index == index)        if ((dmv.v)->index == index)
416          {          {
417            return dmv.v;            return (struct variable *) dmv.v;
418          }          }
419      }      }
420    return NULL;    return NULL;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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