File indexing completed on 2024-05-12 15:27:09
0001 /*************************************************************************** 0002 File : nsl_sf_poly.h 0003 Project : LabPlot 0004 Description : NSL special polynomial functions 0005 -------------------------------------------------------------------- 0006 Copyright : (C) 2016 by Stefan Gerlach (stefan.gerlach@uni.kn) 0007 0008 ***************************************************************************/ 0009 0010 /*************************************************************************** 0011 * * 0012 * This program is free software; you can redistribute it and/or modify * 0013 * it under the terms of the GNU General Public License as published by * 0014 * the Free Software Foundation; either version 2 of the License, or * 0015 * (at your option) any later version. * 0016 * * 0017 * This program is distributed in the hope that it will be useful, * 0018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0020 * GNU General Public License for more details. * 0021 * * 0022 * You should have received a copy of the GNU General Public License * 0023 * along with this program; if not, write to the Free Software * 0024 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 0025 * Boston, MA 02110-1301 USA * 0026 * * 0027 ***************************************************************************/ 0028 0029 #ifndef NSL_SF_POLY_H 0030 #define NSL_SF_POLY_H 0031 0032 #include <stdlib.h> 0033 #include <gsl/gsl_complex.h> 0034 #include <gsl/gsl_complex_math.h> 0035 0036 /* Chebychev T_n(x) */ 0037 double nsl_sf_poly_chebyshev_T(int n, double x); 0038 /* Chebychev U_n(x) */ 0039 double nsl_sf_poly_chebyshev_U(int n, double x); 0040 0041 /* Optimal "L"egendre Polynomials */ 0042 double nsl_sf_poly_optimal_legendre_L(int n, double x); 0043 0044 /* Bessel polynomials y_n(x) */ 0045 gsl_complex nsl_sf_poly_bessel_y(int n, gsl_complex x); 0046 /* reversed Bessel polynomials \theta_n(x) */ 0047 gsl_complex nsl_sf_poly_reversed_bessel_theta(int n, gsl_complex x); 0048 0049 /* interpolating polynomial (Lagrange) 0050 0 - zeroth order (1-point) integral (rectangle rule) 0051 1 - first order (2-point), derivative, integral and absolute area (trapezoid rule) 0052 2 - second order (3-point), derivatives and integral (Simpson's 1/3 rule) 0053 3 - third order (4-point), derivatives and integral (Simpson's 3/8 rule) 0054 4 - fourth order (5-point) and derivatives 0055 6 - sixth order (7-point) and derivatives 0056 TODO: barycentric form (https://en.wikipedia.org/wiki/Lagrange_polynomial) 0057 */ 0058 double nsl_sf_poly_interp_lagrange_0_int(double *x, double y); 0059 double nsl_sf_poly_interp_lagrange_1(double v, double *x, double *y); 0060 double nsl_sf_poly_interp_lagrange_1_deriv(double *x, double *y); 0061 double nsl_sf_poly_interp_lagrange_1_int(double *x, double *y); 0062 double nsl_sf_poly_interp_lagrange_1_absint(double *x, double *y); 0063 double nsl_sf_poly_interp_lagrange_2(double v, double *x, double *y); 0064 double nsl_sf_poly_interp_lagrange_2_deriv(double v, double *x, double *y); 0065 double nsl_sf_poly_interp_lagrange_2_deriv2(double *x, double *y); 0066 double nsl_sf_poly_interp_lagrange_2_int(double *x, double *y); 0067 double nsl_sf_poly_interp_lagrange_3(double v, double *x, double *y); 0068 double nsl_sf_poly_interp_lagrange_3_deriv(double v, double *x, double *y); 0069 double nsl_sf_poly_interp_lagrange_3_deriv2(double v, double *x, double *y); 0070 double nsl_sf_poly_interp_lagrange_3_deriv3(double *x, double *y); 0071 double nsl_sf_poly_interp_lagrange_3_int(double *x, double *y); 0072 double nsl_sf_poly_interp_lagrange_4(double v, double *x, double *y); 0073 double nsl_sf_poly_interp_lagrange_4_deriv(double v, double *x, double *y); 0074 double nsl_sf_poly_interp_lagrange_4_deriv2(double v, double *x, double *y); 0075 double nsl_sf_poly_interp_lagrange_4_deriv3(double v, double *x, double *y); 0076 double nsl_sf_poly_interp_lagrange_4_deriv4(double *x, double *y); 0077 double nsl_sf_poly_interp_lagrange_6_deriv4(double v, double *x, double *y); 0078 double nsl_sf_poly_interp_lagrange_6_deriv5(double v, double *x, double *y); 0079 double nsl_sf_poly_interp_lagrange_6_deriv6(double *x, double *y); 0080 0081 #endif /* NSL_SF_POLY_H */