1 /* PSPP - computes sample statistics.
2 Copyright (C) 2006 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
20 #define casefilter_h 1
23 #include <data/missing-values.h>
29 /* Create a new casefilter that drops cases in which any of the
30 N_VARS variables in VARS are missing in the given CLASS.
31 VARS is an array of variables which if *any* of them are missing.
32 N_VARS is the size of VARS.
34 struct casefilter * casefilter_create (enum mv_class class,
35 struct variable **, int);
37 /* Add the variables in VARS to the list of variables for which the
38 filter considers. N_VARS is the size of VARS */
39 void casefilter_add_variables (struct casefilter *,
40 struct variable *const*, int);
42 /* Destroy the filter FILTER */
43 void casefilter_destroy (struct casefilter *);
45 /* Returns true iff the entire case should be skipped */
46 bool casefilter_skip_case (const struct casefilter *, const struct ccase *);
48 /* Returns true iff the variable V in case C is missing.
49 Note that this function's behaviour is independent of the set of
50 variables contained by the filter.
52 bool casefilter_variable_missing (const struct casefilter *f,
53 const struct ccase *c,
54 const struct variable *v);