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 |
} |
} |
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++; |
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); |
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; |