1 /* 2 * gretl -- Gnu Regression, Econometrics and Time-series Library 3 * Copyright (C) 2001 Allin Cottrell and Riccardo "Jack" Lucchetti 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * 18 */ 19 20 #ifndef MISSING_H 21 #define MISSING_H 22 23 #include <float.h> 24 25 #ifndef isfinite 26 # define isfinite(x) (!isnan(x) && !isinf(x)) 27 #endif 28 29 #ifdef NAN 30 # define NADBL NAN 31 #else 32 # define NADBL 0.0/0.0 33 #endif 34 #define na(x) (isnan(x) || isinf(x)) 35 36 int model_missing (const MODEL *pmod, int t); 37 38 int model_has_missing_obs (const MODEL *pmod); 39 40 int first_missing_index (const double *x, int t1, int t2); 41 42 int series_adjust_sample (const double *x, int *t1, int *t2); 43 44 int list_adjust_sample (const int *list, int *t1, int *t2, 45 const DATASET *dset, int *nmiss); 46 47 int set_miss (const int *list, const char *param, 48 DATASET *dset, PRN *prn); 49 50 double missing_obs_fraction (const DATASET *dset); 51 52 int any_missing_user_values (const DATASET *dset); 53 54 int model_add_missmask (MODEL *pmod, int n); 55 56 #endif /* MISSING_H */ 57