diff --git a/src/backend/nsl/Makefile b/src/backend/nsl/Makefile index d981b2a9c..49a8da381 100644 --- a/src/backend/nsl/Makefile +++ b/src/backend/nsl/Makefile @@ -1,24 +1,18 @@ -all: nsl_stats_test nsl_smooth_mal_test nsl_smooth_percentile_test nsl_smooth_savgol_test nsl_filter_test nsl_filter_test_fftw nsl_geom_linesim_test nsl_geom_linesim_morse_test nsl_fit_test +all: nsl_stats_test nsl_filter_test nsl_filter_test_fftw nsl_geom_linesim_test nsl_geom_linesim_morse_test nsl_fit_test nsl_stats_test: nsl_stats_test.c nsl_stats.c gcc -o $@ $^ -lm -lgsl -lgslcblas -nsl_smooth_mal_test: nsl_smooth_mal_test.c nsl_smooth.c nsl_sf_kernel.c nsl_stats.c - gcc -o $@ $^ -lm -lgsl -lgslcblas -nsl_smooth_percentile_test: nsl_smooth_percentile_test.c nsl_smooth.c nsl_sf_kernel.c nsl_stats.c - gcc -o $@ $^ -lm -lgsl -lgslcblas -nsl_smooth_savgol_test: nsl_smooth_savgol_test.c nsl_smooth.c nsl_sf_kernel.c nsl_stats.c - gcc -o $@ $^ -lm -lgsl -lgslcblas nsl_filter_test: nsl_filter_test.c nsl_filter.c nsl_sf_poly.c gcc -o $@ $^ -lm -lgsl -lgslcblas nsl_filter_test_fftw: nsl_filter_test.c nsl_filter.c nsl_sf_poly.c gcc -o $@ $^ -lm -DHAVE_FFTW3 -lfftw3 -lgsl -lgslcblas nsl_geom_linesim_test: nsl_geom_linesim_test.c nsl_geom_linesim.c nsl_geom.c nsl_sort.c nsl_stats.c gcc -o $@ $^ -lm -lgsl -lgslcblas nsl_geom_linesim_morse_test: nsl_geom_linesim_morse_test.c nsl_geom_linesim.c nsl_geom.c nsl_sort.c nsl_stats.c gcc -O2 -o $@ $^ -lm -lgsl -lgslcblas nsl_fit_test: nsl_fit_test.c nsl_fit.c nsl_sf_basic.c Faddeeva.c gcc -o $@ $^ -lm -lgsl -lgslcblas clean: - rm -f nsl_stats_test nsl_smooth_mal_test nsl_smooth_percentile_test nsl_smooth_savgol_test nsl_dft_test nsl_dft_test_fftw nsl_filter_test nsl_filter_test_fftw nsl_geom_linesim_test nsl_geom_linesim_morse_test nsl_diff_test nsl_fit_test + rm -f nsl_stats_test nsl_dft_test nsl_dft_test_fftw nsl_filter_test nsl_filter_test_fftw nsl_geom_linesim_test nsl_geom_linesim_morse_test nsl_diff_test nsl_fit_test diff --git a/src/backend/nsl/nsl_smooth_mal_test.c b/src/backend/nsl/nsl_smooth_mal_test.c deleted file mode 100644 index fc9e3335e..000000000 --- a/src/backend/nsl/nsl_smooth_mal_test.c +++ /dev/null @@ -1,71 +0,0 @@ -/*************************************************************************** - File : nsl_smooth_mal_test.c - Project : LabPlot - Description : NSL smooth functions - -------------------------------------------------------------------- - Copyright : (C) 2016 by Stefan Gerlach (stefan.gerlach@uni.kn) - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include -#include "nsl_smooth.h" - -int main() { - double data[9]={2,2,5,2,1,0,1,4,9}; - int i,points=5; - nsl_smooth_weight_type weight = nsl_smooth_weight_uniform; - - int status; - printf("pad_none\n"); - status = nsl_smooth_moving_average_lagged(data, 9, points, weight, nsl_smooth_pad_none); - for(i=0;i<9;i++) - printf(" %g",data[i]); - printf(" status = %d\n", status); - /*printf("pad_interp\n"); - status = nsl_smooth_moving_average(data, 9, points, weight, nsl_smooth_pad_interp); - */ - printf("\npad_mirror\n"); - double data2[9]={2,2,5,2,1,0,1,4,9}; - status = nsl_smooth_moving_average_lagged(data2, 9, points, weight, nsl_smooth_pad_mirror); - for(i=0;i<9;i++) - printf(" %g",data2[i]); - printf(" status = %d\n", status); - printf("\npad_nearest\n"); - double data3[9]={2,2,5,2,1,0,1,4,9}; - status = nsl_smooth_moving_average_lagged(data3, 9, points, weight, nsl_smooth_pad_nearest); - for(i=0;i<9;i++) - printf(" %g",data3[i]); - printf(" status = %d\n", status); - printf("\npad_constant\n"); - double data4[9]={2,2,5,2,1,0,1,4,9}; - status = nsl_smooth_moving_average_lagged(data4, 9, points, weight, nsl_smooth_pad_constant); - for(i=0;i<9;i++) - printf(" %g",data4[i]); - printf(" status = %d\n", status); - printf("\npad_periodic\n"); - double data5[9]={2,2,5,2,1,0,1,4,9}; - status = nsl_smooth_moving_average_lagged(data5, 9, points, weight, nsl_smooth_pad_periodic); - for(i=0;i<9;i++) - printf(" %g",data5[i]); - printf(" status = %d\n", status); - puts(""); -} diff --git a/src/backend/nsl/nsl_smooth_percentile_test.c b/src/backend/nsl/nsl_smooth_percentile_test.c deleted file mode 100644 index 9e5dc3fdb..000000000 --- a/src/backend/nsl/nsl_smooth_percentile_test.c +++ /dev/null @@ -1,71 +0,0 @@ -/*************************************************************************** - File : nsl_smooth_percentile_test.c - Project : LabPlot - Description : NSL smooth functions - -------------------------------------------------------------------- - Copyright : (C) 2016 by Stefan Gerlach (stefan.gerlach@uni.kn) - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include -#include "nsl_smooth.h" - -int main() { - double data[9]={2,2,5,2,1,0,1,4,9}; - int i,points=5; - double percentile = 0.5; - - int status; - printf("pad_none\n"); - status = nsl_smooth_percentile(data, 9, points, percentile, nsl_smooth_pad_none); - for(i=0;i<9;i++) - printf(" %g",data[i]); - printf(" status = %d\n", status); - /*printf("pad_interp\n"); - status = nsl_smooth_moving_average(data, 9, points, weight, nsl_smooth_pad_interp); - */ - printf("\npad_mirror\n"); - double data2[9]={2,2,5,2,1,0,1,4,9}; - status = nsl_smooth_percentile(data2, 9, points, percentile, nsl_smooth_pad_mirror); - for(i=0;i<9;i++) - printf(" %g",data2[i]); - printf(" status = %d\n", status); - printf("\npad_nearest\n"); - double data3[9]={2,2,5,2,1,0,1,4,9}; - status = nsl_smooth_percentile(data3, 9, points, percentile, nsl_smooth_pad_nearest); - for(i=0;i<9;i++) - printf(" %g",data3[i]); - printf(" status = %d\n", status); - printf("\npad_constant\n"); - double data4[9]={2,2,5,2,1,0,1,4,9}; - status = nsl_smooth_percentile(data4, 9, points, percentile, nsl_smooth_pad_constant); - for(i=0;i<9;i++) - printf(" %g",data4[i]); - printf(" status = %d\n", status); - printf("\npad_periodic\n"); - double data5[9]={2,2,5,2,1,0,1,4,9}; - status = nsl_smooth_percentile(data5, 9, points, percentile, nsl_smooth_pad_periodic); - for(i=0;i<9;i++) - printf(" %g",data5[i]); - printf(" status = %d\n", status); - puts(""); -} diff --git a/src/backend/nsl/nsl_smooth_savgol_test.c b/src/backend/nsl/nsl_smooth_savgol_test.c deleted file mode 100644 index 123dc1a1f..000000000 --- a/src/backend/nsl/nsl_smooth_savgol_test.c +++ /dev/null @@ -1,123 +0,0 @@ -/*************************************************************************** - File : nsl_smooth_savgol_test.c - Project : LabPlot - Description : NSL smooth functions - -------------------------------------------------------------------- - Copyright : (C) 2016 by Stefan Gerlach (stefan.gerlach@uni.kn) - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - ***************************************************************************/ - -#include -#include "nsl_smooth.h" - -int main() { - /* savgol coefficients */ - int i,j,points=3, order=1; - gsl_matrix *h; - - h = gsl_matrix_alloc(points, points); - nsl_smooth_savgol_coeff(points, order, h); - for(j=0;j