1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2007 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 /* Sort order for comparing cases. */
19 #ifndef DATA_CASE_ORDERING_H
20 #define DATA_CASE_ORDERING_H 1
23 #include <data/case.h>
30 SRT_ASCEND, /* A, B, C, ..., X, Y, Z. */
31 SRT_DESCEND /* Z, Y, X, ..., C, B, A. */
34 /* Creation and destruction. */
35 struct case_ordering *case_ordering_create (void);
36 struct case_ordering *case_ordering_clone (const struct case_ordering *);
37 void case_ordering_destroy (struct case_ordering *);
40 bool case_ordering_add_var (struct case_ordering *,
41 const struct variable *, enum sort_direction);
43 /* Comparing cases. */
44 int case_ordering_compare_cases (const struct ccase *, const struct ccase *,
45 const struct case_ordering *);
48 size_t case_ordering_get_value_cnt (const struct case_ordering *);
49 size_t case_ordering_get_var_cnt (const struct case_ordering *);
50 const struct variable *case_ordering_get_var (const struct case_ordering *,
52 enum sort_direction case_ordering_get_direction (const struct case_ordering *,
54 void case_ordering_get_vars (const struct case_ordering *,
55 const struct variable ***, size_t *);
57 #endif /* data/case-ordering.h */