struct recoded_categorical
{
const struct variable *v; /* Original variable. */
- union value **vals;
- gsl_matrix *m; /* Vector-encoded values of the original
- variable. The ith row of the matrix corresponds
- to the ith value of a categorical variable.
+ union value *vals;
+ gsl_matrix *m; /* Vector-encoded values of the
+ original variable. The ith row of
+ the matrix corresponds to the ith
+ value of a categorical variable.
*/
size_t n_categories;
size_t first_column; /* First column of the gsl_matrix which
variable.
*/
size_t last_column; /* Last column containing the recoded
- categories. The practice of keeping only the
- first and last columns of the matrix implies
- those columns corresponding to v must be
+ categories. The practice of
+ keeping only the first and last
+ columns of the matrix implies those
+ columns corresponding to v must be
contiguous.
*/
- size_t n_allocated_categories; /* This is used only during initialization
- to keep track of the number of values
- stored.
- */
+ size_t n_allocated_categories; /* This is used only during
+ initialization to keep
+ track of the number of
+ values stored.
+ */
};
/*
There are usually multiple categorical variables to recode. Get rid
- of this immediately once the variable structure has been modified to
- contain the binary encoding.
+ of this structure immediately when the variable structure has been
+ modified to contain the binary encoding.
*/
struct recoded_categorical_array
{
in the variable's struct recoded_categorical.
*/
int last_column;
- struct variable *v;
+ const struct variable *v;
};
struct design_matrix
{
*/
size_t n_vars;
};
-const union value *cr_vector_to_value (const gsl_vector *,
- struct recoded_categorical *);
-
-gsl_vector_const_view cr_value_to_vector (const union value *,
- struct recoded_categorical *);
+union value *cr_vector_to_value (const gsl_vector *,
+ struct recoded_categorical *);
void cr_value_update (struct recoded_categorical *, const union value *);
size_t design_matrix_var_to_column (const struct design_matrix *,
const struct variable *);
-const struct variable *design_matrix_col_to_var (const struct design_matrix *,
- size_t);
+struct variable *design_matrix_col_to_var (const struct design_matrix *,
+ size_t);
void
design_matrix_set (struct design_matrix *, size_t,