1 /* PSPP - computes sample statistics.
2 Copyright (C) 2007 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 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, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 /* Sliding window over a set of cases.
21 A casewindow is a queue of cases: cases may be added at the
22 head of the queue and deleted from the tail. A casewindow is
23 initially maintained in memory and then, should it grow too
24 large, is dumped to disk.
26 Any case in the casewindow may be accessed, not just the case
27 at the head. Cases are numbered relative to the tail: the
28 least recently added case is number 0, and so on. */
30 #ifndef DATA_CASEWINDOW_H
31 #define DATA_CASEWINDOW_H 1
34 #include <data/case.h>
36 struct casewindow *casewindow_create (size_t value_cnt,
37 casenumber max_in_core_cases);
38 bool casewindow_destroy (struct casewindow *);
40 void casewindow_push_head (struct casewindow *, struct ccase *);
41 void casewindow_pop_tail (struct casewindow *, casenumber cnt);
42 bool casewindow_get_case (const struct casewindow *, casenumber case_idx,
44 size_t casewindow_get_value_cnt (const struct casewindow *);
45 casenumber casewindow_get_case_cnt (const struct casewindow *);
47 bool casewindow_error (const struct casewindow *);
48 void casewindow_force_error (struct casewindow *);
49 const struct taint *casewindow_get_taint (const struct casewindow *);
51 #endif /* data/casewindow.h */