File indexing completed on 2024-05-12 03:47:52
0001 /* 0002 File : nsl_interp.h 0003 Project : LabPlot 0004 Description : NSL interpolation functions 0005 -------------------------------------------------------------------- 0006 SPDX-FileCopyrightText: 2016 Stefan Gerlach <stefan.gerlach@uni.kn> 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #ifndef NSL_INTERP_H 0011 #define NSL_INTERP_H 0012 0013 #define NSL_INTERP_TYPE_COUNT 11 0014 typedef enum { 0015 nsl_interp_type_linear, 0016 nsl_interp_type_polynomial, 0017 nsl_interp_type_cspline, 0018 nsl_interp_type_cspline_periodic, 0019 nsl_interp_type_akima, 0020 nsl_interp_type_akima_periodic, 0021 nsl_interp_type_steffen, 0022 nsl_interp_type_cosine, 0023 nsl_interp_type_exponential, 0024 nsl_interp_type_pch, 0025 nsl_interp_type_rational 0026 } nsl_interp_type; 0027 extern const char* nsl_interp_type_name[]; 0028 0029 #define NSL_INTERP_PCH_VARIANT_COUNT 4 0030 typedef enum { 0031 nsl_interp_pch_variant_finite_difference, 0032 nsl_interp_pch_variant_catmull_rom, 0033 nsl_interp_pch_variant_cardinal, 0034 nsl_interp_pch_variant_kochanek_bartels 0035 } nsl_interp_pch_variant; 0036 extern const char* nsl_interp_pch_variant_name[]; 0037 0038 #define NSL_INTERP_EVALUATE_COUNT 4 0039 typedef enum { 0040 nsl_interp_evaluate_function, 0041 nsl_interp_evaluate_derivative, 0042 nsl_interp_evaluate_second_derivative, 0043 nsl_interp_evaluate_integral 0044 } nsl_interp_evaluate; 0045 extern const char* nsl_interp_evaluate_name[]; 0046 0047 /* calculates rational interpolation of n points of xy-data at xn using Burlisch-Stoer method. result in v (error dv) */ 0048 int nsl_interp_ratint(const double* x, const double* y, int n, double xn, double* v, double* dv); 0049 0050 #endif /* NSL_INTERP_H */