Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:03:54

0001 /* interpolation/gsl_spline.h
0002  * 
0003  * Copyright (C) 2001, 2007 Brian Gough
0004  * 
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation; either version 3 of the License, or (at
0008  * your option) any later version.
0009  * 
0010  * This program is distributed in the hope that it will be useful, but
0011  * WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * General Public License for more details.
0014  * 
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program; if not, write to the Free Software
0017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef __GSL_SPLINE_H__
0021 #define __GSL_SPLINE_H__
0022 #include <stdlib.h>
0023 #include <gsl/gsl_interp.h>
0024 
0025 #undef __BEGIN_DECLS
0026 #undef __END_DECLS
0027 #ifdef __cplusplus
0028 # define __BEGIN_DECLS extern "C" {
0029 # define __END_DECLS }
0030 #else
0031 # define __BEGIN_DECLS /* empty */
0032 # define __END_DECLS /* empty */
0033 #endif
0034 
0035 __BEGIN_DECLS
0036 
0037 
0038 /* general interpolation object */
0039 typedef struct {
0040   gsl_interp * interp;
0041   double  * x;
0042   double  * y;
0043   size_t  size;
0044 } gsl_spline;
0045 
0046 gsl_spline *
0047 gsl_spline_alloc(const gsl_interp_type * T, size_t size);
0048      
0049 int
0050 gsl_spline_init(gsl_spline * spline, const double xa[], const double ya[], size_t size);
0051 
0052 const char * gsl_spline_name(const gsl_spline * spline);
0053 unsigned int gsl_spline_min_size(const gsl_spline * spline);
0054 
0055 
0056 int
0057 gsl_spline_eval_e(const gsl_spline * spline, double x,
0058                   gsl_interp_accel * a, double * y);
0059 
0060 double
0061 gsl_spline_eval(const gsl_spline * spline, double x, gsl_interp_accel * a);
0062 
0063 int
0064 gsl_spline_eval_deriv_e(const gsl_spline * spline,
0065                         double x,
0066                         gsl_interp_accel * a,
0067                         double * y);
0068 
0069 double
0070 gsl_spline_eval_deriv(const gsl_spline * spline,
0071                       double x,
0072                       gsl_interp_accel * a);
0073 
0074 int
0075 gsl_spline_eval_deriv2_e(const gsl_spline * spline,
0076                          double x,
0077                          gsl_interp_accel * a,
0078                          double * y);
0079 
0080 double
0081 gsl_spline_eval_deriv2(const gsl_spline * spline,
0082                        double x,
0083                        gsl_interp_accel * a);
0084 
0085 int
0086 gsl_spline_eval_integ_e(const gsl_spline * spline,
0087                         double a, double b,
0088                         gsl_interp_accel * acc,
0089                         double * y);
0090 
0091 double
0092 gsl_spline_eval_integ(const gsl_spline * spline,
0093                       double a, double b,
0094                       gsl_interp_accel * acc);
0095 
0096 void
0097 gsl_spline_free(gsl_spline * spline);
0098 
0099 __END_DECLS
0100 
0101 #endif /* __GSL_SPLINE_H__ */