[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: |
Mon, 14 Mar 2005 01:54:42 -0500 |
Index: pspp/src/dictionary.c
diff -u pspp/src/dictionary.c:1.13 pspp/src/dictionary.c:1.14
--- pspp/src/dictionary.c:1.13 Fri Feb 11 08:22:05 2005
+++ pspp/src/dictionary.c Mon Mar 14 06:54:40 2005
@@ -701,6 +701,30 @@
}
}
+/* Copies values from SRC, which represents a case arranged
+ according to dictionary D, to DST, which represents a case
+ arranged according to the dictionary that will be produced by
+ dict_compact_values(D). */
+void
+dict_compact_case (const struct dictionary *d,
+ struct ccase *dst, const struct ccase *src)
+{
+ size_t i;
+ size_t value_idx;
+
+ value_idx = 0;
+ for (i = 0; i < d->var_cnt; i++)
+ {
+ struct variable *v = d->var[i];
+
+ if (dict_class_from_id (v->name) != DC_SCRATCH)
+ {
+ case_copy (dst, value_idx, src, v->fv, v->nv);
+ value_idx += v->nv;
+ }
+ }
+}
+
/* Returns the number of values that would be used by a case if
dict_compact_values() were called. */
size_t
- [Pspp-cvs] Changes to pspp/src/dictionary.c,
Ben Pfaff <=