| 1 |
/* interpolation/gsl_spline.h |
| 2 |
* |
| 3 |
* Copyright (C) 2001, 2007 Brian Gough |
| 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 (at |
| 8 |
* your option) any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, but |
| 11 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* 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, write to the Free Software |
| 17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#ifndef __GSL_SPLINE_H__ |
| 21 |
#define __GSL_SPLINE_H__ |
| 22 |
#include <stdlib.h> |
| 23 |
#include "gsl_interp.h" |
| 24 |
|
| 25 |
#undef __BEGIN_DECLS |
| 26 |
#undef __END_DECLS |
| 27 |
#ifdef __cplusplus |
| 28 |
# define __BEGIN_DECLS extern "C" { |
| 29 |
# define __END_DECLS } |
| 30 |
#else |
| 31 |
# define __BEGIN_DECLS /* empty */ |
| 32 |
# define __END_DECLS /* empty */ |
| 33 |
#endif |
| 34 |
|
| 35 |
__BEGIN_DECLS |
| 36 |
|
| 37 |
|
| 38 |
/* general interpolation object */ |
| 39 |
typedef struct { |
| 40 |
gsl_interp * interp; |
| 41 |
double * x; |
| 42 |
double * y; |
| 43 |
size_t size; |
| 44 |
} gsl_spline; |
| 45 |
|
| 46 |
gsl_spline * |
| 47 |
gsl_spline_alloc(const gsl_interp_type * T, size_t size); |
| 48 |
|
| 49 |
int |
| 50 |
gsl_spline_init(gsl_spline * spline, const double xa[], const double ya[], size_t size); |
| 51 |
|
| 52 |
const char * gsl_spline_name(const gsl_spline * spline); |
| 53 |
unsigned int gsl_spline_min_size(const gsl_spline * spline); |
| 54 |
|
| 55 |
|
| 56 |
int |
| 57 |
gsl_spline_eval_e(const gsl_spline * spline, double x, |
| 58 |
gsl_interp_accel * a, double * y); |
| 59 |
|
| 60 |
double |
| 61 |
gsl_spline_eval(const gsl_spline * spline, double x, gsl_interp_accel * a); |
| 62 |
|
| 63 |
int |
| 64 |
gsl_spline_eval_deriv_e(const gsl_spline * spline, |
| 65 |
double x, |
| 66 |
gsl_interp_accel * a, |
| 67 |
double * y); |
| 68 |
|
| 69 |
double |
| 70 |
gsl_spline_eval_deriv(const gsl_spline * spline, |
| 71 |
double x, |
| 72 |
gsl_interp_accel * a); |
| 73 |
|
| 74 |
int |
| 75 |
gsl_spline_eval_deriv2_e(const gsl_spline * spline, |
| 76 |
double x, |
| 77 |
gsl_interp_accel * a, |
| 78 |
double * y); |
| 79 |
|
| 80 |
double |
| 81 |
gsl_spline_eval_deriv2(const gsl_spline * spline, |
| 82 |
double x, |
| 83 |
gsl_interp_accel * a); |
| 84 |
|
| 85 |
int |
| 86 |
gsl_spline_eval_integ_e(const gsl_spline * spline, |
| 87 |
double a, double b, |
| 88 |
gsl_interp_accel * acc, |
| 89 |
double * y); |
| 90 |
|
| 91 |
double |
| 92 |
gsl_spline_eval_integ(const gsl_spline * spline, |
| 93 |
double a, double b, |
| 94 |
gsl_interp_accel * acc); |
| 95 |
|
| 96 |
void |
| 97 |
gsl_spline_free(gsl_spline * spline); |
| 98 |
|
| 99 |
__END_DECLS |
| 100 |
|
| 101 |
#endif /* __GSL_INTERP_H__ */ |