pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

var_create_internal again


From: Jason Stover
Subject: var_create_internal again
Date: Fri, 12 Jun 2009 18:24:15 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

I need to be able to set an interaction_variable's internal
variable type to alpha.

I need to do this in get_sum, in covariance-matrix.c. The problem
is that the code needs to use some of the features in category.c,
and that is hard to access without being able to see when an internal
variable's type is alpha.

Here is the purpose: The internal "interaction variable" is a variable
essential to computations in GLM, but it's particular values won't be
useful to the user. Right now, it can only be type numeric, which is
causing the trouble.

On IRC, Ben mentioned clarifying what var_create_internal is for, and
either changing it, or dropping it, or using something else. So:
What's the best way to make an "internal" variable, one whose values
are to be hidden from the user, but that is used for computations?

Here is a quick fix:

struct variable *
var_create_internal (int case_idx, int width)
{
  struct variable *v = var_create ("$internal", width);
...

This small change will allow an internal variable to be type alpha,
which is OK by me.  But does it fit the idea of an "internal variable"
in other uses?

-Jason




reply via email to

[Prev in Thread] Current Thread [Next in Thread]