+Wed Dec 6 21:14:26 2006 Ben Pfaff <blp@gnu.org>
+
+ * regression.q (reg_inserted): Compare variable pointers instead
+ of variable indexes.
+
Mon Dec 4 22:33:46 2006 Ben Pfaff <blp@gnu.org>
* crosstabs.q (insert_summary): Use var_to_string for labeling.
for (i = 0; i < n_vars; i++)
{
- if (v->index == varlist[i]->index)
+ if (v == varlist[i])
{
return 1;
}
+Wed Dec 6 21:14:59 2006 Ben Pfaff <blp@gnu.org>
+
+ * coefficient.c: (pspp_coeff_get_value) Compare variable pointers
+ instead of variable indexes.
+ (pspp_linreg_get_coeff) Ditto.
+ (design_matrix_col_to_var_index) Removed.
+ (design_matrix_col_to_var) Compare variable pointers
+ instead of variable indexes.
+ (cmp_dm_var_index) Ditto.
+ (design_matrix_var_to_column) Ditto.
+ (dm_var_to_last_column) Ditto.
+
Sun Nov 5 08:30:32 WST 2006 John Darrington <john@darrington.wattle.id.au>
* levene.c levene.h Changed to use the new casefilter structure.
while (i < c->n_vars)
{
candidate = pspp_coeff_get_var (c, i);
- if (v->index == candidate->index)
+ if (v == candidate)
{
return (c->v_info + i)->val;
}
result = c->coeff[i];
tmp = pspp_coeff_get_var (result, 0);
- while (tmp->index != v->index && i < c->n_coeffs)
+ while (tmp != v && i < c->n_coeffs)
{
result = c->coeff[i];
tmp = pspp_coeff_get_var (result, 0);
If v is categorical, we need to ensure the coefficient
matches the VAL.
*/
- while (tmp->index != v->index && i < c->n_coeffs
+ while (tmp != v && i < c->n_coeffs
&& compare_values (pspp_coeff_get_value (result, tmp),
val, var_get_width (v)))
{ /* FIX THIS */
Return the index of the variable for the
given column.
*/
-static size_t
-design_matrix_col_to_var_index (const struct design_matrix *dm, size_t col)
+struct variable *
+design_matrix_col_to_var (const struct design_matrix *dm, size_t col)
{
size_t i;
struct design_matrix_var v;
{
v = dm->vars[i];
if (v.first_column <= col && col <= v.last_column)
- return (v.v)->index;
- }
- return DM_INDEX_NOT_FOUND;
-}
-
-/*
- Return a pointer to the variable whose values
- are stored in column col.
- */
-struct variable *
-design_matrix_col_to_var (const struct design_matrix *dm, size_t col)
-{
- size_t index;
- size_t i;
- struct design_matrix_var dmv;
-
- index = design_matrix_col_to_var_index (dm, col);
- for (i = 0; i < dm->n_vars; i++)
- {
- dmv = dm->vars[i];
- if ((dmv.v)->index == index)
- {
- return (struct variable *) dmv.v;
- }
+ return (struct variable *) v.v;
}
return NULL;
}
-static size_t
-cmp_dm_var_index (const struct design_matrix_var *dmv, size_t index)
-{
- if (dmv->v->index == index)
- return 1;
- return 0;
-}
-
/*
Return the number of the first column which holds the
values for variable v.
for (i = 0; i < dm->n_vars; i++)
{
tmp = dm->vars[i];
- if (cmp_dm_var_index (&tmp, v->index))
+ if (tmp.v == v)
{
return tmp.first_column;
}
for (i = 0; i < dm->n_vars; i++)
{
tmp = dm->vars[i];
- if (cmp_dm_var_index (&tmp, v->index))
+ if (tmp.v == v)
{
return tmp.last_column;
}
+Wed Dec 6 21:16:22 2006 Ben Pfaff <blp@gnu.org>
+
+ * linreg.c: (pspp_linreg_get_vars) Compare variable pointers
+ instead of variable indexes.
+
2006-05-19 Jason Stover <jhs@math.gcsu.edu>
* coefficient.c: Moved to src/math.
/* Repeated variables are likely to bunch together, at the end
of the array. */
i = result - 1;
- while (i >= 0 && (v[i]->index != tmp->index))
+ while (i >= 0 && v[i] != tmp)
{
i--;
}