[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] Changes to pspp/src/dictionary.c
From: |
Ben Pfaff |
Subject: |
[Pspp-cvs] Changes to pspp/src/dictionary.c |
Date: |
Sun, 21 Aug 2005 03:21:08 -0400 |
Index: pspp/src/dictionary.c
diff -u pspp/src/dictionary.c:1.26 pspp/src/dictionary.c:1.27
--- pspp/src/dictionary.c:1.26 Sun Aug 7 04:39:28 2005
+++ pspp/src/dictionary.c Sun Aug 21 07:21:06 2005
@@ -491,6 +491,23 @@
dict_delete_var (d, *vars++);
}
+/* Deletes scratch variables from dictionary D. */
+void
+dict_delete_scratch_vars (struct dictionary *d)
+{
+ int i;
+
+ /* FIXME: this can be done in O(count) time, but this algorithm
+ is O(count**2). */
+ assert (d != NULL);
+
+ for (i = 0; i < d->var_cnt; )
+ if (dict_class_from_id (d->var[i]->name) == DC_SCRATCH)
+ dict_delete_var (d, d->var[i]);
+ else
+ i++;
+}
+
/* Moves V to 0-based position IDX in D. Other variables in D,
if any, retain their relative positions. Runs in time linear
in the distance moved. */