Fixed bug reporting the significance of paired value t-test.
[pspp-builds.git] / src / data / case-ordering.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2007 Free Software Foundation, Inc.
3
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.
8
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.
13
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/>. */
16
17 /* Sort order for comparing cases. */
18
19 #ifndef DATA_CASE_ORDERING_H
20 #define DATA_CASE_ORDERING_H 1
21
22 #include <stddef.h>
23 #include <data/case.h>
24
25 struct dictionary;
26
27 /* Sort direction. */
28 enum sort_direction
29   {
30     SRT_ASCEND,                 /* A, B, C, ..., X, Y, Z. */
31     SRT_DESCEND                 /* Z, Y, X, ..., C, B, A. */
32   };
33
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 *);
38
39 /* Modification. */
40 bool case_ordering_add_var (struct case_ordering *,
41                             const struct variable *, enum sort_direction);
42
43 /* Comparing cases. */
44 int case_ordering_compare_cases (const struct ccase *, const struct ccase *,
45                                  const struct case_ordering *);
46
47 /* Inspection. */
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 *,
51                                               size_t);
52 enum sort_direction case_ordering_get_direction (const struct case_ordering *,
53                                                  size_t);
54 void case_ordering_get_vars (const struct case_ordering *,
55                              const struct variable ***, size_t *);
56
57 #endif /* data/case-ordering.h */