Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /* interpolation/gsl_spline2d.h
0002  * 
0003  * Copyright 2012 David Zaslavsky
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_SPLINE2D_H__
0021 #define __GSL_SPLINE2D_H__
0022 
0023 #include <gsl/gsl_interp.h>
0024 #include <gsl/gsl_interp2d.h>
0025 
0026 #undef __BEGIN_DECLS
0027 #undef __END_DECLS
0028 #ifdef __cplusplus
0029 # define __BEGIN_DECLS extern "C" {
0030 # define __END_DECLS }
0031 #else
0032 # define __BEGIN_DECLS /* empty */
0033 # define __END_DECLS /* empty */
0034 #endif
0035 
0036 __BEGIN_DECLS
0037 
0038 
0039 /*
0040  * A 2D interpolation object which stores the arrays defining the function.
0041  * In all other respects, this is just like a gsl_interp2d object.
0042  */
0043 typedef struct
0044 {
0045   gsl_interp2d interp_object; /* low-level interpolation object */
0046   double * xarr;              /* x data array */
0047   double * yarr;              /* y data array */
0048   double * zarr;              /* z data array */
0049 } gsl_spline2d;
0050 
0051 gsl_spline2d * gsl_spline2d_alloc(const gsl_interp2d_type * T, size_t xsize, size_t ysize);
0052 
0053 int gsl_spline2d_init(gsl_spline2d * interp, const double xa[],
0054                       const double ya[], const double za[],
0055                       size_t xsize, size_t ysize);
0056 
0057 void gsl_spline2d_free(gsl_spline2d * interp);
0058 
0059 double gsl_spline2d_eval(const gsl_spline2d * interp, const double x,
0060                          const double y, gsl_interp_accel* xa, gsl_interp_accel* ya);
0061 
0062 int gsl_spline2d_eval_e(const gsl_spline2d * interp, const double x,
0063                         const double y, gsl_interp_accel* xa, gsl_interp_accel* ya,
0064                         double * z);
0065 
0066 double gsl_spline2d_eval_extrap(const gsl_spline2d * interp, const double x,
0067                                 const double y, gsl_interp_accel* xa, gsl_interp_accel* ya);
0068 
0069 int gsl_spline2d_eval_extrap_e(const gsl_spline2d * interp, const double x,
0070                                const double y, gsl_interp_accel* xa, gsl_interp_accel* ya,
0071                                double * z);
0072 
0073 double gsl_spline2d_eval_deriv_x(const gsl_spline2d * interp, const double x,
0074                                  const double y, gsl_interp_accel* xa, gsl_interp_accel* ya);
0075 
0076 int gsl_spline2d_eval_deriv_x_e(const gsl_spline2d * interp, const double x,
0077                                 const double y, gsl_interp_accel* xa,
0078                                 gsl_interp_accel* ya, double * z);
0079 
0080 double gsl_spline2d_eval_deriv_y(const gsl_spline2d * interp, const double x,
0081                                  const double y, gsl_interp_accel* xa,
0082                                  gsl_interp_accel* ya);
0083 
0084 int gsl_spline2d_eval_deriv_y_e(const gsl_spline2d * interp, const double x,
0085                                 const double y, gsl_interp_accel* xa,
0086                                 gsl_interp_accel* ya, double * z);
0087 
0088 double gsl_spline2d_eval_deriv_xx(const gsl_spline2d * interp, const double x,
0089                                   const double y, gsl_interp_accel* xa, gsl_interp_accel* ya);
0090 
0091 int gsl_spline2d_eval_deriv_xx_e(const gsl_spline2d * interp, const double x,
0092                                  const double y, gsl_interp_accel* xa,
0093                                  gsl_interp_accel* ya, double * z);
0094 
0095 double gsl_spline2d_eval_deriv_yy(const gsl_spline2d * interp, const double x,
0096                                   const double y, gsl_interp_accel* xa, gsl_interp_accel* ya);
0097 
0098 int gsl_spline2d_eval_deriv_yy_e(const gsl_spline2d * interp, const double x,
0099                                  const double y, gsl_interp_accel* xa,
0100                                  gsl_interp_accel* ya, double * z);
0101 
0102 double gsl_spline2d_eval_deriv_xy(const gsl_spline2d * interp, const double x,
0103                                   const double y, gsl_interp_accel* xa, gsl_interp_accel* ya);
0104 
0105 int gsl_spline2d_eval_deriv_xy_e(const gsl_spline2d * interp, const double x,
0106                                  const double y, gsl_interp_accel* xa,
0107                                  gsl_interp_accel* ya, double * z);
0108 
0109 size_t gsl_spline2d_min_size(const gsl_spline2d * interp);
0110 
0111 const char * gsl_spline2d_name(const gsl_spline2d * interp);
0112 
0113 int gsl_spline2d_set(const gsl_spline2d * interp, double zarr[],
0114                      const size_t i, const size_t j, const double z);
0115 double gsl_spline2d_get(const gsl_spline2d * interp, const double zarr[],
0116                         const size_t i, const size_t j);
0117 
0118 __END_DECLS
0119 
0120 #endif /* __GSL_SPLINE2D_H__ */