2 * Copyright (C) <2001> David Schleef <ds@schleef.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or any later version.
9 * This library 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 GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 #ifndef __FUNCTABLE_H__
22 #define __FUNCTABLE_H__
24 typedef void FunctableFunc (double *fx, double *dfx, double x, void *closure);
26 typedef struct _Functable Functable;
33 double inv_multiplier;
39 Functable *functable_new (void);
40 void functable_setup (Functable *t);
41 void functable_free (Functable *t);
43 void functable_set_length (Functable *t, int length);
44 void functable_set_offset (Functable *t, double offset);
45 void functable_set_multiplier (Functable *t, double multiplier);
46 void functable_calculate (Functable *t, FunctableFunc func, void *closure);
47 void functable_calculate_multiply (Functable *t, FunctableFunc func, void *closure);
50 double functable_evaluate (Functable *t,double x);
52 double functable_fir(Functable *t,double x0,int n,double *data,int len);
53 void functable_fir2(Functable *t,double *r0, double *r1, double x0,
54 int n,double *data,int len);
56 void functable_func_sinc(double *fx, double *dfx, double x, void *closure);
57 void functable_func_boxcar(double *fx, double *dfx, double x, void *closure);
58 void functable_func_hanning(double *fx, double *dfx, double x, void *closure);
60 #endif /* __PRIVATE_H__ */