From 65ce5a2a8727fc32c4ad53451902df3247867802 Mon Sep 17 00:00:00 2001 From: tvolkmer Date: Fri, 4 Feb 2022 21:16:18 +0100 Subject: [PATCH 01/19] binary build files of 3.5.3-rc1 --- linux-build-mex.sh | 4 ++-- macos-build-mex.sh | 4 ++-- windows-build-dll.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/linux-build-mex.sh b/linux-build-mex.sh index 332687fd..3d684ea1 100755 --- a/linux-build-mex.sh +++ b/linux-build-mex.sh @@ -31,8 +31,8 @@ set -ex exec > >(tee linux-build-mex.log) exec 2>&1 -FFTWVERSION=3.3.9 -GCCVERSION=8.5.0 +FFTWVERSION=3.3.8 +GCCVERSION=11.2.0 GCCARCH=haswell BINARIES_ARCH_README=' Please note that since the binaries were compiled with gcc flag -march=haswell, diff --git a/macos-build-mex.sh b/macos-build-mex.sh index 2660cd48..5ec545ea 100755 --- a/macos-build-mex.sh +++ b/macos-build-mex.sh @@ -19,11 +19,11 @@ set -ex GCCARCH=haswell FFTWDIR=/usr/local -GCC="gcc-9 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" +GCC="gcc-11" # default values (to be overwritten if respective parameters are set) OCTAVEDIR=/usr/local - +MATLABDIR=/Applications/MATLAB_R2021b.app # read the options TEMP=`getopt -o o:m:f:v: --long octave:,matlab:,matlab-version:,fftw: -n 'macos-build-mex.sh' -- "$@"` eval set -- "$TEMP" diff --git a/windows-build-dll.sh b/windows-build-dll.sh index 5fd81d86..3922356d 100644 --- a/windows-build-dll.sh +++ b/windows-build-dll.sh @@ -24,7 +24,7 @@ set -ex # default values (to be overwritten if respective parameters are set) FFTWVERSION=3.3.8 -OCTAVEVERSION=5.2.0 +OCTAVEVERSION=6.4.0 MATLABVERSION="" ARCH=64 GCCARCH="" From c3de47561669d1b859c9a92bfea1d5983430b5dc Mon Sep 17 00:00:00 2001 From: Michael Quellmalz Date: Sat, 5 Feb 2022 14:32:10 +0100 Subject: [PATCH 02/19] Add missing function declarations in imex.h for odd degree N --- matlab/imex.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/matlab/imex.h b/matlab/imex.h index 4c510acb..0ea985e6 100644 --- a/matlab/imex.h +++ b/matlab/imex.h @@ -49,8 +49,11 @@ int nfft_mex_get_int(const mxArray *p, const char *errmsg); double nfft_mex_get_double(const mxArray *p, const char *errmsg); void nfft_mex_get_nm(const mxArray *prhs[], int *n, int *m); +void nfft_mex_get_nm_odd(const mxArray *prhs[], int *n, int *m); void nfft_mex_get_n1n2m(const mxArray *prhs[], int *n1, int *n2, int *m); +void nfft_mex_get_n1n2m_odd(const mxArray *prhs[], int *n1, int *n2, int *m); void nfft_mex_get_n1n2n3m(const mxArray *prhs[], int *n1, int *n2, int *n3, int *m); +void nfft_mex_get_n1n2n3m_odd(const mxArray *prhs[], int *n1, int *n2, int *n3, int *m); void nfft_mex_check_nargs(const int nrhs, const int n, const char* errmsg); int nfft_mex_set_num_threads_check(const int nrhs, const mxArray *prhs[], void **plans, const int plans_num_allocated); From 3a71648c72e7c9533746cc88f19d51aef9673ef8 Mon Sep 17 00:00:00 2001 From: Toni Volkmer Date: Sat, 5 Feb 2022 23:09:11 +0100 Subject: [PATCH 03/19] revert macro to AC_PROG_CC_C99 due to issue with autoconf-2.69 (gcc-arch flag and -ffast-math do not work) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7af5ce6d..61da48a6 100644 --- a/configure.ac +++ b/configure.ac @@ -278,7 +278,7 @@ AC_LANG(C) AX_COMPILER_VENDOR # check for C99 compliant mode (possibly with GNU extensions) -AC_PROG_CC +AC_PROG_CC_C99 # per-target flags AM_PROG_CC_C_O From 85d7c17e53f66cf2a9571cb0baec4eab8716bd94 Mon Sep 17 00:00:00 2001 From: Toni Volkmer Date: Sat, 5 Feb 2022 23:44:38 +0100 Subject: [PATCH 04/19] updated binary build scripts --- linux-build-mex.sh | 2 +- macos-build-mex.sh | 2 +- windows-build-dll.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-build-mex.sh b/linux-build-mex.sh index 3d684ea1..d98a937e 100755 --- a/linux-build-mex.sh +++ b/linux-build-mex.sh @@ -31,7 +31,7 @@ set -ex exec > >(tee linux-build-mex.log) exec 2>&1 -FFTWVERSION=3.3.8 +FFTWVERSION=3.3.10 GCCVERSION=11.2.0 GCCARCH=haswell BINARIES_ARCH_README=' diff --git a/macos-build-mex.sh b/macos-build-mex.sh index 5ec545ea..14fd4e66 100755 --- a/macos-build-mex.sh +++ b/macos-build-mex.sh @@ -4,7 +4,7 @@ # A Matlab installation must be specified in order to build the # Matlab interface. The paths should not contain spaces! # -# The script is known to work on macOS 10.5 Catalina with Homebrew. +# The script is known to work on macOS 11 Big Sur with Homebrew. # # At least the following packages are required: # octave gnu-sed cunit diff --git a/windows-build-dll.sh b/windows-build-dll.sh index 3922356d..1476b093 100644 --- a/windows-build-dll.sh +++ b/windows-build-dll.sh @@ -6,7 +6,7 @@ # The Matlab path should not contain spaces! # # Example call: -# ./nfft-build-dll.sh --fftw=3.3.8 --octave=5.2.0 --matlab=/c/path/to/matlab +# ./nfft-build-dll.sh --fftw=3.3.10 --octave=6.4.0 --matlab=/c/path/to/matlab # # WARNING: This script downloads and compiles FFTW and downloads GCC, Julia and Octave (requires ~ 3GB). # @@ -23,7 +23,7 @@ set -ex # default values (to be overwritten if respective parameters are set) -FFTWVERSION=3.3.8 +FFTWVERSION=3.3.10 OCTAVEVERSION=6.4.0 MATLABVERSION="" ARCH=64 From 9f1c39343148e2da39bbd1dfc8d0cb7fd9ad976f Mon Sep 17 00:00:00 2001 From: Michael Quellmalz Date: Sun, 11 Dec 2022 12:57:31 +0100 Subject: [PATCH 05/19] Add Bibtex entry in Readme --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 906ee997..de7424b7 100644 --- a/README.md +++ b/README.md @@ -86,9 +86,19 @@ make install Citing ------ -The most current general paper, the one that we recommend if you wish to cite NFFT, is *Keiner, J., Kunis, S., and Potts, D. +The current general paper, the one that we recommend if you wish to cite NFFT, is *Keiner, J., Kunis, S., and Potts, D. ''Using NFFT 3 - a software library for various nonequispaced fast Fourier transforms'' -ACM Trans. Math. Software,36, Article 19, 1-30, 2009*. +ACM Trans. Math. Software 36, Article 19, 1-30, 2009*. BibTeX entry: +``` +@article{KeKuPo09, + author = {Jens Keiner and Stefan Kunis and Daniel Potts}, + title = {Using {NFFT3} - a Software Library for Various Nonequispaced Fast {Fourier} Transforms}, + journal = {{ACM} Trans. Math. Software}, + year = {2009}, + volume = {36}, + pages = {Article 19, 1--30}, + doi = {10.1145/1555386.1555388}} +``` Feedback -------- From f43fd65965127887cb7e3c10341ce04f518e61c9 Mon Sep 17 00:00:00 2001 From: Michael Quellmalz Date: Sun, 11 Dec 2022 13:09:42 +0100 Subject: [PATCH 06/19] github-actions: julia is not included in ubuntu --- .github/workflows/c-cpp.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 3851bb41..170e28c4 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -16,7 +16,12 @@ jobs: - name: Install libraries run: | sudo apt-get update - sudo apt-get install libfftw3-dev libcunit1-dev liboctave-dev julia + sudo apt-get install libfftw3-dev libcunit1-dev liboctave-dev + - name: Download julia + run: | + wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.3-linux-x86_64.tar.gz + tar zxvf julia-1.8.3-linux-x86_64.tar.gz + JULIA="$(pwd)/julia-1.8.3/bin/julia" - name: bootstrap run: ./bootstrap.sh - name: configure @@ -28,6 +33,6 @@ jobs: - name: run Octave testfiles run: for DIR in matlab/nf*t matlab/fastsum; do cd $DIR; for NAME in simple_test*.m; do octave --eval="run('$NAME')"; done; cd ../..; done - name: run Julia testfiles - run: for DIR in julia/nf*t julia/fastsum; do cd $DIR; for NAME in simple_test*.jl; do julia "$NAME"; done; cd ../..; done + run: for DIR in julia/nf*t julia/fastsum; do cd $DIR; for NAME in simple_test*.jl; do "$JULIA" "$NAME"; done; cd ../..; done - name: make dist run: make dist From 40450fbc48b078807f7f01bcdfc0f2a3b69a997a Mon Sep 17 00:00:00 2001 From: Michael Quellmalz Date: Sun, 11 Dec 2022 13:27:39 +0100 Subject: [PATCH 07/19] github-workflow: julia path --- .github/workflows/c-cpp.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 170e28c4..02ce3bb2 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -19,9 +19,11 @@ jobs: sudo apt-get install libfftw3-dev libcunit1-dev liboctave-dev - name: Download julia run: | - wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.3-linux-x86_64.tar.gz - tar zxvf julia-1.8.3-linux-x86_64.tar.gz + wget -q https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.3-linux-x86_64.tar.gz + tar zxf julia-1.8.3-linux-x86_64.tar.gz JULIA="$(pwd)/julia-1.8.3/bin/julia" + echo $JULIA + ls - name: bootstrap run: ./bootstrap.sh - name: configure From caa1746e8df7b536691b694bf0b8fef14ad9f6ef Mon Sep 17 00:00:00 2001 From: Michael Quellmalz Date: Sun, 11 Dec 2022 13:43:21 +0100 Subject: [PATCH 08/19] github-workflow: try to get right julia path --- .github/workflows/c-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 02ce3bb2..cb74ce3b 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -22,8 +22,8 @@ jobs: wget -q https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.3-linux-x86_64.tar.gz tar zxf julia-1.8.3-linux-x86_64.tar.gz JULIA="$(pwd)/julia-1.8.3/bin/julia" - echo $JULIA ls + ls julia-1.8.3 - name: bootstrap run: ./bootstrap.sh - name: configure @@ -35,6 +35,6 @@ jobs: - name: run Octave testfiles run: for DIR in matlab/nf*t matlab/fastsum; do cd $DIR; for NAME in simple_test*.m; do octave --eval="run('$NAME')"; done; cd ../..; done - name: run Julia testfiles - run: for DIR in julia/nf*t julia/fastsum; do cd $DIR; for NAME in simple_test*.jl; do "$JULIA" "$NAME"; done; cd ../..; done + run: for DIR in julia/nf*t julia/fastsum; do cd $DIR; for NAME in simple_test*.jl; do ../../julia-1.8.3/bin/julia "$NAME"; done; cd ../..; done - name: make dist run: make dist From c9b2399c434a35ab8c305d3531c700a44f2c82ba Mon Sep 17 00:00:00 2001 From: Michael Quellmalz Date: Sun, 11 Dec 2022 14:23:45 +0100 Subject: [PATCH 09/19] github-workflow: julia should be installed already --- .github/workflows/c-cpp.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index cb74ce3b..7f317d72 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -17,13 +17,6 @@ jobs: run: | sudo apt-get update sudo apt-get install libfftw3-dev libcunit1-dev liboctave-dev - - name: Download julia - run: | - wget -q https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.3-linux-x86_64.tar.gz - tar zxf julia-1.8.3-linux-x86_64.tar.gz - JULIA="$(pwd)/julia-1.8.3/bin/julia" - ls - ls julia-1.8.3 - name: bootstrap run: ./bootstrap.sh - name: configure @@ -35,6 +28,6 @@ jobs: - name: run Octave testfiles run: for DIR in matlab/nf*t matlab/fastsum; do cd $DIR; for NAME in simple_test*.m; do octave --eval="run('$NAME')"; done; cd ../..; done - name: run Julia testfiles - run: for DIR in julia/nf*t julia/fastsum; do cd $DIR; for NAME in simple_test*.jl; do ../../julia-1.8.3/bin/julia "$NAME"; done; cd ../..; done + run: for DIR in julia/nf*t julia/fastsum; do cd $DIR; for NAME in simple_test*.jl; do julia "$NAME"; done; cd ../..; done - name: make dist run: make dist From 97be77019c1065ffdeaa2e0fbd70a33c51766b3a Mon Sep 17 00:00:00 2001 From: Michael Quellmalz Date: Sun, 11 Dec 2022 17:08:18 +0100 Subject: [PATCH 10/19] Add required software in Readme #127 --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index de7424b7..00bacf23 100644 --- a/README.md +++ b/README.md @@ -37,16 +37,16 @@ Some examples for application of these transforms are provided: Detailed API documentation in HTML format can be found in `doc/html/index.html`, if you are working from a release tarball. When working from a source repository, the documentation can be -generated with Doxygen. +generated with Doxygen (which requires the `doxygen-latex` and `perl` packages): ``` make doc ``` Building -------- -The NFFT depends on the [FFTW](https://fftw.org) library, which is available for many Linux distros, Homebrew on macOS and MSYS2 on Windows. If you compile the FFTW yourself, it should be configured with the flag `--enable-shared`. +The NFFT depends on the [FFTW](https://fftw.org) library, which is available for many Linux distros, Homebrew on macOS and MSYS2 on Windows. If you compile the FFTW yourself, it should be configured with the flag `--enable-shared` (and `--enable-threads` for the multi-threaded version). Building the NFFT requires `make` and a C compiler such as `gcc`. -When working from a source repository, you need to run libtoolize and autoreconf first. A bash script to do this is provided. +When working from a source repository, you need to run libtoolize and autoreconf first. A bash script to do this is provided. This step requries the tools `autoconf`, `automake` and `libtool`. ``` ./bootstrap.sh ``` @@ -65,7 +65,7 @@ Here are some useful optional flags for `./configure`: * `--enable-all` specifies that all modules should be compiled, * `--enable-openmp` enables the multicore support and * `--enable-julia` specifies that the julia interface will be compiled. -* `--with-matlab=/path/to/matlab` specifies a path of Matlab, and +* `--with-matlab=/path/to/matlab` specifies the path of a Matlab installation, and * `--with-octave=/path/to/octave` does the same for GNU Octave. * For a list of all available options, run `./configure --help`. @@ -104,7 +104,7 @@ Feedback -------- Your comments are welcome! This is the third version of the library and may not be as robust or well documented as it should be. Please keep track of bugs -or missing/confusing instructions and report them to +or missing/confusing instructions and report them in our issue tracker or directly to [Daniel Potts](mailto:potts@mathematik.tu-chemnitz.de). The postal address is From 307593de5f0e14047c0d9cf152674fd427db6721 Mon Sep 17 00:00:00 2001 From: Michael Quellmalz Date: Sun, 11 Dec 2022 17:14:18 +0100 Subject: [PATCH 11/19] github-workflow: install doxygen --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 7f317d72..86c6f784 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -16,7 +16,7 @@ jobs: - name: Install libraries run: | sudo apt-get update - sudo apt-get install libfftw3-dev libcunit1-dev liboctave-dev + sudo apt-get install libfftw3-dev libcunit1-dev liboctave-dev doxygen-latex graphviz - name: bootstrap run: ./bootstrap.sh - name: configure From 281f59e930d61039411efad37e3da5f0c2ca6970 Mon Sep 17 00:00:00 2001 From: Franziska Nestler Date: Tue, 14 Feb 2023 10:31:38 +0100 Subject: [PATCH 12/19] added kernel absx --- applications/fastsum/fastsum.m | 1 + applications/fastsum/fastsum_matlab.c | 2 ++ applications/fastsum/fastsum_test.c | 2 ++ applications/fastsum/kernels.c | 16 ++++++++++++++++ applications/fastsum/kernels.h | 1 + julia/fastsum/libfastsumjulia.c | 4 ++++ matlab/fastsum/fastsummex.c | 2 ++ matlab/fastsum/simple_test.m | 1 + matlab/fastsum/test_fastsum.m | 13 +++++++------ 9 files changed, 36 insertions(+), 6 deletions(-) diff --git a/applications/fastsum/fastsum.m b/applications/fastsum/fastsum.m index 56c534ce..2358b985 100644 --- a/applications/fastsum/fastsum.m +++ b/applications/fastsum/fastsum.m @@ -49,6 +49,7 @@ % 'one_over_cube' K(x) = 1/x^3 % 'laplacian_rbf' K(x) = EXP(-|x|/c) % 'xx_gaussian' K(x) = x^2/c^2 EXP(-x^2/c^2) +% 'absx' K(x) = |x| % % Markus Fenn, 2006. diff --git a/applications/fastsum/fastsum_matlab.c b/applications/fastsum/fastsum_matlab.c index 522ef6d5..365eab23 100644 --- a/applications/fastsum/fastsum_matlab.c +++ b/applications/fastsum/fastsum_matlab.c @@ -124,6 +124,8 @@ int main(int argc, char **argv) kernel = laplacian_rbf; else if (strcmp(s, "xx_gaussian") == 0) kernel = xx_gaussian; + else if (strcmp(s, "absx") == 0) + kernel = absx; else { printf("Unrecognized kernel function!\n"); diff --git a/applications/fastsum/fastsum_test.c b/applications/fastsum/fastsum_test.c index 467202e1..016e6eb4 100644 --- a/applications/fastsum/fastsum_test.c +++ b/applications/fastsum/fastsum_test.c @@ -126,6 +126,8 @@ int main(int argc, char **argv) kernel = laplacian_rbf; else if (strcmp(s, "xx_gaussian") == 0) kernel = xx_gaussian; + else if (strcmp(s, "absx") == 0) + kernel = absx; else { s = "multiquadric"; diff --git a/applications/fastsum/kernels.c b/applications/fastsum/kernels.c index 34b3ca90..f17f66b3 100644 --- a/applications/fastsum/kernels.c +++ b/applications/fastsum/kernels.c @@ -457,6 +457,22 @@ C xx_gaussian(R x, int der, const R *param) /* K(x)=x^2/c^2 EXP(-x^2/c^2) */ return value / (c*c); } +C absx(R x, int der, const R *param) /* K(x)=|x| */ +{ + R value=K(0.0); + + (void)param; + + if (der == 0) value=FABS(x); + else if (der == 1){ + if (x<0) value=K(-1.0); + else value=K(1.0); + } + else value=K(0.0); + + return value; +} + /* \} */ /* kernels.c */ diff --git a/applications/fastsum/kernels.h b/applications/fastsum/kernels.h index 006a376e..f5766ff7 100644 --- a/applications/fastsum/kernels.h +++ b/applications/fastsum/kernels.h @@ -57,6 +57,7 @@ C one_over_cube(R x, int der, const R *param); /**< K(x) = 1/x^3 */ C log_sin(R x, int der, const R *param); /**< K(x) = log(|sin(cx)|) */ C laplacian_rbf(R x, int der, const R *param); /**< K(x) = exp(-|x|/c) */ C xx_gaussian(R x, int der, const R *param); /**< K(x) = x^2/c^2 exp(-x^2/c^2) */ +C absx(R x, int der, const R *param); /**< K(x) = |x| */ /* \} */ #ifdef __cplusplus diff --git a/julia/fastsum/libfastsumjulia.c b/julia/fastsum/libfastsumjulia.c index 6050c66a..8b42fd75 100644 --- a/julia/fastsum/libfastsumjulia.c +++ b/julia/fastsum/libfastsumjulia.c @@ -55,6 +55,10 @@ int jfastsum_init( fastsum_plan* p, int d, char* s, double* c, unsigned int f, i kernel = log_sin; else if ( strcmp(s, "laplacian_rbf") == 0 ) kernel = laplacian_rbf; + else if ( strcmp(s, "xx_gaussian") == 0 ) + kernel = xx_gaussian; + else if ( strcmp(s, "absx") == 0 ) + kernel = absx; else { return 1; } diff --git a/matlab/fastsum/fastsummex.c b/matlab/fastsum/fastsummex.c index e0e725f7..47fece56 100644 --- a/matlab/fastsum/fastsummex.c +++ b/matlab/fastsum/fastsummex.c @@ -136,6 +136,8 @@ static kernel get_kernel(const mxArray *p) ker = laplacian_rbf; else if (strcmp(s, "xx_gaussian") == 0) ker = xx_gaussian; + else if (strcmp(s, "absx") == 0) + ker = absx; else mexErrMsgTxt("fastsum: Unknown kernel function."); return ker; diff --git a/matlab/fastsum/simple_test.m b/matlab/fastsum/simple_test.m index 14052637..d5534f26 100644 --- a/matlab/fastsum/simple_test.m +++ b/matlab/fastsum/simple_test.m @@ -40,6 +40,7 @@ % 'log_sin' K(x) = LOG(|SIN(cx)|) % 'laplacian_rbf' K(x) = EXP(-|x|/c) % 'xx_gaussian' K(x) = x^2/c^2 EXP(-x^2/c^2) +% 'absx' K(x) = |x| %% Initialize parameters d = 2; % number of dimensions diff --git a/matlab/fastsum/test_fastsum.m b/matlab/fastsum/test_fastsum.m index 7e2dc015..dad54956 100644 --- a/matlab/fastsum/test_fastsum.m +++ b/matlab/fastsum/test_fastsum.m @@ -40,18 +40,19 @@ % 'log_sin' K(x) = LOG(|SIN(cx)|) % 'laplacian_rbf' K(x) = EXP(-|x|/c) % 'xx_gaussian' K(x) = x^2/c^2 EXP(-x^2/c^2) +% 'absx' K(x) = |x| %% Initialize parameters d = 2; % number of dimensions N = 2000; % number of source knots M = 2000; % number of target knots -kernel = 'multiquadric'; -c = 1/sqrt(N); % kernel parameter +kernel = 'xx_gaussian'; +c = 100; % kernel parameter p = 3; % degree of smoothness of regularization flags = 0; % flags (could be EXACT_NEARFIELD or NEARFIELD_BOXES) -n = 156; % expansion degree -eps_I = p/n; % inner boundary -eps_B = 1/16; % outer boundary +n = 32; % expansion degree +eps_I = 0.0;%p/n; % inner boundary +eps_B = 0.0;%1/16; % outer boundary m = p; % cut-off parameter for NFFT nn_oversampled=2*n; % oversampling factor for NFFT @@ -60,7 +61,7 @@ phi = rand(N,1)*2*pi; x = [r.*cos(phi) r.*sin(phi)]; % random coefficients -alpha = rand(N,1) + 1i*rand(N,1); +alpha = ones(N,1);%rand(N,1) + 1i*rand(N,1); % random target nodes in circle of radius 0.25-eps_B/2 r = sqrt(rand(M,1))*(0.25-eps_B/2); phi = rand(M,1)*2*pi; From 66d7cc71d807c84c41a2c9b36831d2fd86bdb4bc Mon Sep 17 00:00:00 2001 From: Franziska Nestler Date: Tue, 14 Feb 2023 10:47:52 +0100 Subject: [PATCH 13/19] repaired original setup in test_fastsum.m --- matlab/fastsum/test_fastsum.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/matlab/fastsum/test_fastsum.m b/matlab/fastsum/test_fastsum.m index dad54956..d316a0c2 100644 --- a/matlab/fastsum/test_fastsum.m +++ b/matlab/fastsum/test_fastsum.m @@ -46,13 +46,13 @@ d = 2; % number of dimensions N = 2000; % number of source knots M = 2000; % number of target knots -kernel = 'xx_gaussian'; -c = 100; % kernel parameter +kernel = 'multiquadric'; +c = 1/sqrt(N); % kernel parameter p = 3; % degree of smoothness of regularization flags = 0; % flags (could be EXACT_NEARFIELD or NEARFIELD_BOXES) -n = 32; % expansion degree -eps_I = 0.0;%p/n; % inner boundary -eps_B = 0.0;%1/16; % outer boundary +n = 156; % expansion degree +eps_I = p/n; % inner boundary +eps_B = 1/16; % outer boundary m = p; % cut-off parameter for NFFT nn_oversampled=2*n; % oversampling factor for NFFT @@ -61,7 +61,7 @@ phi = rand(N,1)*2*pi; x = [r.*cos(phi) r.*sin(phi)]; % random coefficients -alpha = ones(N,1);%rand(N,1) + 1i*rand(N,1); +alpha = rand(N,1) + 1i*rand(N,1); % random target nodes in circle of radius 0.25-eps_B/2 r = sqrt(rand(M,1))*(0.25-eps_B/2); phi = rand(M,1)*2*pi; From d1238a7a4d30c8710b9dba3570bd597144b88ac8 Mon Sep 17 00:00:00 2001 From: Toni Volkmer Date: Thu, 23 Feb 2023 23:27:14 +0100 Subject: [PATCH 14/19] increased version number to 3.5.4 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 61da48a6..fe302ac2 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ m4_define([nfft_version_major], [3]) m4_define([nfft_version_minor], [5]) -m4_define([nfft_version_patch], [3]) +m4_define([nfft_version_patch], [4]) m4_define([nfft_version_type], [alpha]) m4_append([NFFT_VERSION], m4_expand([nfft_version_major.nfft_version_minor.nfft_version_patch])) m4_append([NFFT_VERSION], m4_expand([nfft_version_type])) From e202f0cba948321acd7fef8554e3751511e37370 Mon Sep 17 00:00:00 2001 From: theresa Date: Wed, 10 Apr 2024 15:34:56 +0200 Subject: [PATCH 15/19] added kernel der_laplacian_rbf --- applications/fastsum/fastsum.m | 1 + applications/fastsum/fastsum_matlab.c | 2 ++ applications/fastsum/fastsum_test.c | 2 ++ applications/fastsum/kernels.c | 17 +++++++++++++++++ applications/fastsum/kernels.h | 1 + 5 files changed, 23 insertions(+) diff --git a/applications/fastsum/fastsum.m b/applications/fastsum/fastsum.m index 2358b985..3aefc435 100644 --- a/applications/fastsum/fastsum.m +++ b/applications/fastsum/fastsum.m @@ -48,6 +48,7 @@ % 'cot' K(x) = cot(cx) % 'one_over_cube' K(x) = 1/x^3 % 'laplacian_rbf' K(x) = EXP(-|x|/c) +% 'der_laplacian_rbf' K(x) = |x|/c EXP(-|x|/c) % 'xx_gaussian' K(x) = x^2/c^2 EXP(-x^2/c^2) % 'absx' K(x) = |x| % diff --git a/applications/fastsum/fastsum_matlab.c b/applications/fastsum/fastsum_matlab.c index 365eab23..952cb91f 100644 --- a/applications/fastsum/fastsum_matlab.c +++ b/applications/fastsum/fastsum_matlab.c @@ -122,6 +122,8 @@ int main(int argc, char **argv) kernel = log_sin; else if (strcmp(s, "laplacian_rbf") == 0) kernel = laplacian_rbf; + else if (strcmp(s, "der_laplacian_rbf") == 0) + kernel = der_laplacian_rbf; else if (strcmp(s, "xx_gaussian") == 0) kernel = xx_gaussian; else if (strcmp(s, "absx") == 0) diff --git a/applications/fastsum/fastsum_test.c b/applications/fastsum/fastsum_test.c index 016e6eb4..a9a0ea99 100644 --- a/applications/fastsum/fastsum_test.c +++ b/applications/fastsum/fastsum_test.c @@ -124,6 +124,8 @@ int main(int argc, char **argv) kernel = log_sin; else if (strcmp(s, "laplacian_rbf") == 0) kernel = laplacian_rbf; + else if (strcmp(s, "der_laplacian_rbf") == 0) + kernel = der_laplacian_rbf; else if (strcmp(s, "xx_gaussian") == 0) kernel = xx_gaussian; else if (strcmp(s, "absx") == 0) diff --git a/applications/fastsum/kernels.c b/applications/fastsum/kernels.c index f17f66b3..4b79f864 100644 --- a/applications/fastsum/kernels.c +++ b/applications/fastsum/kernels.c @@ -431,6 +431,23 @@ C laplacian_rbf(R x, int der, const R *param) /* K(x)=EXP(-|x|/c) */ return value; } +C der_laplacian_rbf(R x, int der, const R *param) /* K(x)=|x|/c EXP(-|x|/c) */ +{ + R c = param[0]; + R value = K(0.0); + + switch (der) + { + case 0 : value = (FABS(x)/c)*EXP(-FABS(x)/c); break; + default: + value = (POW(K(-1.0),(R)der))*((FABS(x)-(R)der*c)/POW(c,(R)der+1))*EXP(-FABS(x)/c); + if (x < K(0.0)) + value *= POW(K(-1.0),(R)der); + } + + return value; +} + C xx_gaussian(R x, int der, const R *param) /* K(x)=x^2/c^2 EXP(-x^2/c^2) */ { R c = param[0]; diff --git a/applications/fastsum/kernels.h b/applications/fastsum/kernels.h index f5766ff7..0742c1b8 100644 --- a/applications/fastsum/kernels.h +++ b/applications/fastsum/kernels.h @@ -56,6 +56,7 @@ C kcot(R x, int der, const R *param); /**< K(x) = cot(cx) */ C one_over_cube(R x, int der, const R *param); /**< K(x) = 1/x^3 */ C log_sin(R x, int der, const R *param); /**< K(x) = log(|sin(cx)|) */ C laplacian_rbf(R x, int der, const R *param); /**< K(x) = exp(-|x|/c) */ +C der_laplacian_rbf(R x, int der, const R *param); /**< K(x) = |x|/c exp(-|x|/c) */ C xx_gaussian(R x, int der, const R *param); /**< K(x) = x^2/c^2 exp(-x^2/c^2) */ C absx(R x, int der, const R *param); /**< K(x) = |x| */ /* \} */ From 583def2e4d10cfc27238c7d4a472c51f3dda2f25 Mon Sep 17 00:00:00 2001 From: theresa Date: Wed, 10 Apr 2024 15:54:43 +0200 Subject: [PATCH 16/19] adapted julia and matlab files for der_laplacian_kernel --- julia/fastsum/libfastsumjulia.c | 2 ++ matlab/fastsum/fastsummex.c | 2 ++ matlab/fastsum/simple_test.m | 1 + matlab/fastsum/test_fastsum.m | 1 + 4 files changed, 6 insertions(+) diff --git a/julia/fastsum/libfastsumjulia.c b/julia/fastsum/libfastsumjulia.c index 8b42fd75..c74021b2 100644 --- a/julia/fastsum/libfastsumjulia.c +++ b/julia/fastsum/libfastsumjulia.c @@ -55,6 +55,8 @@ int jfastsum_init( fastsum_plan* p, int d, char* s, double* c, unsigned int f, i kernel = log_sin; else if ( strcmp(s, "laplacian_rbf") == 0 ) kernel = laplacian_rbf; + else if ( strcmp(s, "der_laplacian_rbf") == 0 ) + kernel = der_laplacian_rbf; else if ( strcmp(s, "xx_gaussian") == 0 ) kernel = xx_gaussian; else if ( strcmp(s, "absx") == 0 ) diff --git a/matlab/fastsum/fastsummex.c b/matlab/fastsum/fastsummex.c index 47fece56..ea50560a 100644 --- a/matlab/fastsum/fastsummex.c +++ b/matlab/fastsum/fastsummex.c @@ -134,6 +134,8 @@ static kernel get_kernel(const mxArray *p) ker = log_sin; else if (strcmp(s, "laplacian_rbf") == 0) ker = laplacian_rbf; + else if (strcmp(s, "der_laplacian_rbf") == 0) + ker = der_laplacian_rbf; else if (strcmp(s, "xx_gaussian") == 0) ker = xx_gaussian; else if (strcmp(s, "absx") == 0) diff --git a/matlab/fastsum/simple_test.m b/matlab/fastsum/simple_test.m index d5534f26..6ed15571 100644 --- a/matlab/fastsum/simple_test.m +++ b/matlab/fastsum/simple_test.m @@ -39,6 +39,7 @@ % 'one_over_cube' K(x) = 1/x^3 % 'log_sin' K(x) = LOG(|SIN(cx)|) % 'laplacian_rbf' K(x) = EXP(-|x|/c) +% 'der_laplacian_rbf' K(x) = |x|/c EXP(-|x|/c) % 'xx_gaussian' K(x) = x^2/c^2 EXP(-x^2/c^2) % 'absx' K(x) = |x| diff --git a/matlab/fastsum/test_fastsum.m b/matlab/fastsum/test_fastsum.m index d316a0c2..ab1aff68 100644 --- a/matlab/fastsum/test_fastsum.m +++ b/matlab/fastsum/test_fastsum.m @@ -39,6 +39,7 @@ % 'one_over_cube' K(x) = 1/x^3 % 'log_sin' K(x) = LOG(|SIN(cx)|) % 'laplacian_rbf' K(x) = EXP(-|x|/c) +% 'der_laplacian_rbf' K(x) = |x|/c EXP(-|x|/c) % 'xx_gaussian' K(x) = x^2/c^2 EXP(-x^2/c^2) % 'absx' K(x) = |x| From e1ef14cccd39ef916eec88526c0c6d8b5a6a956b Mon Sep 17 00:00:00 2001 From: theresa Date: Tue, 16 Apr 2024 13:15:00 +0200 Subject: [PATCH 17/19] increased efficiency of computations --- applications/fastsum/kernels.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/applications/fastsum/kernels.c b/applications/fastsum/kernels.c index 4b79f864..ee9d0575 100644 --- a/applications/fastsum/kernels.c +++ b/applications/fastsum/kernels.c @@ -441,8 +441,7 @@ C der_laplacian_rbf(R x, int der, const R *param) /* K(x)=|x|/c EXP(-|x|/c) * case 0 : value = (FABS(x)/c)*EXP(-FABS(x)/c); break; default: value = (POW(K(-1.0),(R)der))*((FABS(x)-(R)der*c)/POW(c,(R)der+1))*EXP(-FABS(x)/c); - if (x < K(0.0)) - value *= POW(K(-1.0),(R)der); + value *= 1 - 2 * ((x < K(0.0)) && (der % 2.0)); } return value; From 5098ca9593f4440b7c06708e6f3283e65363fe09 Mon Sep 17 00:00:00 2001 From: theresa Date: Tue, 16 Apr 2024 13:35:12 +0200 Subject: [PATCH 18/19] fixed bug --- applications/fastsum/kernels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/fastsum/kernels.c b/applications/fastsum/kernels.c index ee9d0575..de27b90a 100644 --- a/applications/fastsum/kernels.c +++ b/applications/fastsum/kernels.c @@ -441,7 +441,7 @@ C der_laplacian_rbf(R x, int der, const R *param) /* K(x)=|x|/c EXP(-|x|/c) * case 0 : value = (FABS(x)/c)*EXP(-FABS(x)/c); break; default: value = (POW(K(-1.0),(R)der))*((FABS(x)-(R)der*c)/POW(c,(R)der+1))*EXP(-FABS(x)/c); - value *= 1 - 2 * ((x < K(0.0)) && (der % 2.0)); + value *= 1 - 2 * ((x < K(0.0)) && (der % 2)); } return value; From e9a1352be9aaf1ad94aae30934fb30002c5b9f8d Mon Sep 17 00:00:00 2001 From: Ralf Hielscher Date: Wed, 24 Apr 2024 12:46:41 +0200 Subject: [PATCH 19/19] allow configure to run on ARM Mac --- m4/ax_prog_matlab.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/m4/ax_prog_matlab.m4 b/m4/ax_prog_matlab.m4 index 25ff7f3a..2f6a131c 100644 --- a/m4/ax_prog_matlab.m4 +++ b/m4/ax_prog_matlab.m4 @@ -104,6 +104,7 @@ AC_DEFUN([AX_PROG_MATLAB], mac) matlab_mexext="mexmac";; maci) matlab_mexext="mexmaci";; maci64) matlab_mexext="mexmaci64";; + maca64) matlab_mexext="mexmaca64";; sol64) matlab_mexext="mexs64";; win32) matlab_mexext="mexw32";; win64) matlab_mexext="mexw64";; @@ -171,6 +172,7 @@ AC_DEFUN([AX_PROG_MATLAB], mexmac) matlab_arch="mac";; mexmaci) matlab_arch="maci";; mexmaci64) matlab_arch="maci64";; + mexmaca64) matlab_arch="maca64";; mexs64) matlab_arch="sol64";; mexw32) matlab_arch="win32";; mexw64) matlab_arch="win64";; @@ -185,6 +187,7 @@ AC_DEFUN([AX_PROG_MATLAB], mac) matlab_mexext="mexmac";; maci) matlab_mexext="mexmaci";; maci64) matlab_mexext="mexmaci64";; + maca64) matlab_mexext="mexmaca64";; sol64) matlab_mexext="mexs64";; win32) matlab_mexext="mexw32";; win64) matlab_mexext="mexw64";; @@ -205,7 +208,7 @@ AC_DEFUN([AX_PROG_MATLAB], # dynamic library extension for architecture case $matlab_arch in glnx86|glnxa64|sol|sol64) matlab_libext=".so";; - mac|mac64|maci|maci64) matlab_libext=".dylib";; + mac|mac64|maci|maci64|maca64) matlab_libext=".dylib";; win32|win64) matlab_libext=".dll";; *) AC_MSG_ERROR([Unsupported or invalid architecture ${matlab_arch}.]);; esac