[nfft] 01/01: Imported Upstream version 3.3.1

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu May 5 14:43:46 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch upstream/latest
in repository nfft.

commit 07f7f9dbc8496dabb513c10b187fdf6eab13436d
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date:   Thu May 5 10:15:23 2016 +0100

    Imported Upstream version 3.3.1
---
 .gitignore                               |  2 +-
 .travis.yml                              | 71 ++++++++++++++++++++------------
 ChangeLog                                |  9 +++-
 applications/fastsum/fastsum.m           |  7 +++-
 applications/fastsumS2/fastsumS2.m       | 10 +++--
 applications/mri/mri2d/mri.m             | 21 ++++++++--
 applications/mri/mri2d/mri_inh.m         | 21 ++++++++--
 applications/mri/mri3d/mri.m             | 28 +++++++++++--
 applications/polarFFT/fft_test.m         | 21 ++++++++--
 applications/quadratureS2/quadratureS2.m |  8 +++-
 applications/radon/radon.m               | 14 ++++++-
 applications/radon/ridgelet.m            | 14 ++++++-
 configure.ac                             | 16 ++++++-
 examples/nfft/flags.m                    | 11 +++--
 examples/nfft/simple_test_threads.c.in   |  2 +-
 examples/nfft/taylor_nfft.c              |  6 +--
 examples/nfft/taylor_nfft.m              | 13 ++++--
 examples/solver/glacier.m                |  7 +++-
 examples/solver/glacier_cv.m             |  7 +++-
 include/infft.h                          | 12 ++++--
 include/nfft3.h                          |  4 +-
 include/nfft3mp.h                        | 12 ++++--
 kernel/util/Makefile.am                  |  2 +-
 kernel/util/bspline.c                    | 12 ++----
 kernel/util/version.c                    | 26 ++++++++++++
 m4/ax_prog_matlab.m4                     | 14 +++++--
 matlab/Makefile.am                       |  7 +++-
 tests/bspline.c                          |  2 +-
 tests/nfft.c                             |  6 +--
 29 files changed, 290 insertions(+), 95 deletions(-)

diff --git a/.gitignore b/.gitignore
index 42a8100..511b63b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -71,7 +71,7 @@ include/config.h
 include/stamp-h1
 include/ticks.h
 libtool
-nfft3.pc
+*.pc
 **/.libs/*
 applications/fastgauss/fastgauss
 applications/fastsum/fastsum_matlab
diff --git a/.travis.yml b/.travis.yml
index fe4d61e..90d07ab 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,38 +1,55 @@
 language: c
 compiler:
-    - gcc
-    - clang
+- gcc
+- clang
 os: linux
-
-# Turn off sudo to run on container based infrastructure.
 sudo: false
-
 addons:
   apt:
     packages:
     - libfftw3-dev
     - libcunit1-dev
-
+    - doxygen
 env:
-  - WINDOW=kaiserbessel PRECISION=
-  - WINDOW=gaussian PRECISION=
-  - WINDOW=bspline PRECISION=
-  - WINDOW=sinc PRECISION=
-  - WINDOW=kaiserbessel PRECISION=--enable-float
-  - WINDOW=gaussian PRECISION=--enable-float
-  - WINDOW=bspline PRECISION=--enable-float
-  - WINDOW=sinc PRECISION=--enable-float
-  - WINDOW=kaiserbessel PRECISION=--enable-long-double
-  - WINDOW=gaussian PRECISION=--enable-long-double
-  - WINDOW=bspline PRECISION=--enable-long-double
-  - WINDOW=sinc PRECISION=--enable-long-double
-
-# Compile, link, and run tests.
-script: ./bootstrap.sh && ./configure --with-window=$WINDOW $PRECISION --enable-all $(if test "$CC" = "clang"; then echo ""; else echo "--enable-openmp"; fi) && make && make check
-
-## Print config.log for debugging.
-after_failure: "cat config.log"
-
-# Turn off email notifications.
+- WINDOW=kaiserbessel PRECISION=
+- WINDOW=gaussian PRECISION=
+- WINDOW=bspline PRECISION=
+- WINDOW=sinc PRECISION=
+- WINDOW=kaiserbessel PRECISION=--enable-float
+- WINDOW=gaussian PRECISION=--enable-float
+- WINDOW=bspline PRECISION=--enable-float
+- WINDOW=sinc PRECISION=--enable-float
+- WINDOW=kaiserbessel PRECISION=--enable-long-double
+- WINDOW=gaussian PRECISION=--enable-long-double
+- WINDOW=bspline PRECISION=--enable-long-double
+- WINDOW=sinc PRECISION=--enable-long-double
+- WINDOW=kaiserbessel PRECISION= DIST=dist
+before_script:
+  if [ "x$TRAVIS_TAG" != "x" ]; then
+    TRAVIS_TAG=$(sed -e 's/\([0-9]*\.[0-9]*\.[0-9]*\)\(.*\)/\1.\2/' <<< "$TRAVIS_TAG");
+    a=( ${TRAVIS_TAG//./ } );
+    if [ ${#a[@]} -gt 2 ]; then
+      sed -e "s/\(m4_define(\[nfft_version_major\], \[\).*\(\])\)/\1${a[0]}\2/" -e "s/\(m4_define(\[nfft_version_minor\], \[\).*\(\])\)/\1${a[1]}\2/" -e "s/\(m4_define(\[nfft_version_patch\], \[\).*\(\])\)/\1${a[2]}\2/" -e "s/\(m4_define(\[nfft_version_type\], \[\).*\(\])\)/\1${a[3]}\2/" configure.ac > configure.ac.modified;
+      mv configure.ac.modified configure.ac;
+    fi
+  fi
+script: ./bootstrap.sh && ./configure --with-window=$WINDOW $PRECISION --enable-all
+  $(if test "$CC" = "clang"; then echo ""; else echo "--enable-openmp"; fi) && make
+  && make check && make $DIST
+after_failure: cat config.log
 notifications:
-   email: false
+  email: false
+before_deploy:
+- export NFFT_DISTRO=$(ls *.tar.gz)
+- echo "Deploying $NFFT_DISTRO to GitHub releases..."
+deploy:
+  provider: releases
+  api_key:
+    secure: RzoI1Acp6lZncLnsINrEByZlL2EecIi9IygLFAklyF4YlMWRNhnu+ePW3AovFI7jU8v0H9LmSM0KYi3dIEUpQbQd46IVErihD2dZmICyxqpn1HUrfmpd3EQ1wFBA3wkCmvOWXcN3n8bCDDDV4HX6d/AQtRCp7G6HK+na8fG7JJqkBah50PytU9rcUCHIvzywg6HKQn1rbYOXhDcJs64Ns2F+z5iMlOHA02lRJgmO+5oU3Q2Bhk1V+JypEmMQ8u7zI9/TOVjMzIA0VVz68GiRHBShSRb5VPsGqhWZqqx0shpQqYVd7S9S50AURaqsSGTMmxM3pgWltkx8kUBGwessuX4uB5MdjyZwa1EJV0qIqCVxkxdX925P1zqR/0CBcbwRl9hIB6NytKodraoUbK7B3SaRF64a+l8h5gYBQfhZZEp5itkdvf+hOKQknCPiULS0yhzFLKYTui3h6iVToA2ncYzsesJdcO3v [...]
+  file_glob: true
+  file: ${NFFT_DISTRO}
+  skip_cleanup: true
+  on:
+    condition: $DIST = dist
+    tags: true
+    repo: NFFT/nfft
diff --git a/ChangeLog b/ChangeLog
index 7a140e0..964df30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,10 +3,15 @@ This file contains the version history for NFFT 3.x.x.
 Changes in version 3.3.1:
 
     Bugfixes
-    - #11 NFSFT module crashes due to pointer type incompatibility.
     - #2 NFFT/NFST/NFCT transforms fail when using certain window functions.
+    - #11 NFSFT module crashes due to pointer type incompatibility.
+    - #14 applications\fastsum\fastsum_matlab produces wrong results in Windows.
+    - #15 Fixes for Matlab applications/examples in Windows.
+    - #16 X(bsplines)(n, x) can be inaccurate when x is close to zero.
+    - #17 MATLAB r2015b/r2016a don't ship symlink libmfftw3.so to libmfftw3.so.3.
+    - #18 Define format string for ptrdiff_t in platform-dependent macro.
 
-    Enhancements
+    Improvements
     - #3 Allow to select scope of unit tests via configure.
     - #1 Extend Travis CI configuration.
 
diff --git a/applications/fastsum/fastsum.m b/applications/fastsum/fastsum.m
index 3cb0136..a18c992 100644
--- a/applications/fastsum/fastsum.m
+++ b/applications/fastsum/fastsum.m
@@ -45,7 +45,12 @@ save -ascii -double alpha.dat alpha2
 save -ascii -double y.dat y
 
 %execute C-program for fast summation
-system(sprintf('./fastsum_matlab %d %d %d %d %d %d %s %e %e %e',d,N,M,n,m,p,kernel,c,eps_I,eps_B));
+if ispc
+    cmd='fastsum_matlab.exe';
+else 
+    cmd='./fastsum_matlab';
+end
+system(sprintf('%s %d %d %d %d %d %d %s %e %e %e',cmd,d,N,M,n,m,p,kernel,c,eps_I,eps_B));
 
 %read result from file
 f2=load('f.dat');
diff --git a/applications/fastsumS2/fastsumS2.m b/applications/fastsumS2/fastsumS2.m
index 21aa9a9..f30bfcf 100644
--- a/applications/fastsumS2/fastsumS2.m
+++ b/applications/fastsumS2/fastsumS2.m
@@ -24,7 +24,11 @@ infilename = 'data.in';
 % The output file name.
 outfilename = 'data.out';
 % The name of the fastsumS2.c executable
-programname = 'fastsumS2';
+if ispc
+    programname='fastsumS2.exe';
+else 
+    programname='./fastsumS2';
+end
 % The name of the file to write the time measurements table to.
 texfilename = 'table.tex';
 
@@ -143,7 +147,7 @@ if (selection > 0 && selection <= 4)
 
   % Call fastsumS2.c with the generated input file writing the output to the
   % output file.
-  system(sprintf('./%s < %s > %s',programname,infilename,outfilename));
+  system(sprintf('%s < %s > %s',programname,infilename,outfilename));
 
   % Open the output file.
   file = fopen(outfilename,'r');
@@ -235,7 +239,7 @@ elseif (selection == 5)
 
   % Call fastsumS2.c with the generated input file writing the output to the
   % output file.
-  system(sprintf('./%s < %s > %s',programname,infilename,outfilename));
+  system(sprintf('%s < %s > %s',programname,infilename,outfilename));
 
   % Open the output file.
   file = fopen(outfilename,'r');
diff --git a/applications/mri/mri2d/mri.m b/applications/mri/mri2d/mri.m
index 907fd6a..45a61a9 100644
--- a/applications/mri/mri2d/mri.m
+++ b/applications/mri/mri2d/mri.m
@@ -32,7 +32,12 @@ M = construct_knots_spiral(N,1);
 
 % Make a 2d-NFFT on the constructed knots
 % and write the output to output_data_phantom_nfft.dat
-system(['./construct_data_2d ' 'output_phantom_nfft.dat ' ...
+if ispc
+    cmd='construct_data_2d.exe';
+else 
+    cmd='./construct_data_2d';
+end
+system([cmd ' output_phantom_nfft.dat ' ...
          int2str(N) ' ' int2str(M)]);
 
 % Precompute the weights using voronoi cells
@@ -44,7 +49,12 @@ precompute_weights('output_phantom_nfft.dat',M);
 % The usage is "./reconstruct_data_2 filename N M ITER WEIGHTS"
 % where ITER is the number of iteration and WEIGHTS is 1
 % if the weights are used 0 else
-system(['./reconstruct_data_2d ' 'output_phantom_nfft.dat ' ...
+if ispc
+    cmd='reconstruct_data_2d.exe';
+else 
+    cmd='./reconstruct_data_2d';
+end
+system([cmd ' output_phantom_nfft.dat ' ...
          int2str(N) ' ' int2str(M)  ' 3 1']);
 
 % Visualize the two dimensional phantom. Make a pic
@@ -59,7 +69,12 @@ rms('pics/rms_2d.txt');
 % The same as above but reconstructed with gridding
 % That means an adjoint 2d-NFFT
 % The ITER parameter is unused and just for compatibility
-system(['./reconstruct_data_gridding ' 'output_phantom_nfft.dat ' ...
+if ispc
+    cmd='reconstruct_data_gridding.exe';
+else 
+    cmd='./reconstruct_data_gridding';
+end
+system([cmd ' output_phantom_nfft.dat ' ...
          int2str(N) ' ' int2str(M)  ' 5 1']);
 visualize_data('pics/pic_gridding', N, 2, '2d-NFFT (Gridding)');
 rms('pics/rms_gridding.txt');
diff --git a/applications/mri/mri2d/mri_inh.m b/applications/mri/mri2d/mri_inh.m
index ff8c58e..b287849 100644
--- a/applications/mri/mri2d/mri_inh.m
+++ b/applications/mri/mri2d/mri_inh.m
@@ -38,7 +38,12 @@ save input_f.dat -ascii out
 
 % Construct the k-space data considering the fieldmap
 % and write the output to output_data_phantom_nfft.dat
-system(['./construct_data_inh_2d1d ' 'output_phantom_nfft.dat ' ...
+if ispc
+    cmd='construct_data_inh_2d1d.exe';
+else 
+    cmd='./construct_data_inh_2d1d';
+end
+system([cmd ' output_phantom_nfft.dat ' ...
          int2str(N) ' ' int2str(M)]);
 
 % Precompute the weights using voronoi cells
@@ -51,7 +56,12 @@ precompute_weights('output_phantom_nfft.dat',M);
 % where ITER is the number of iteration and WEIGHTS is 1
 % if the weights are used 0 else
 % The other methods can be used by replacing 2d1d with 3d or nnfft
-system(['./reconstruct_data_inh_2d1d ' 'output_phantom_nfft.dat ' ...
+if ispc
+    cmd='reconstruct_data_inh_2d1d.exe';
+else 
+    cmd='./reconstruct_data_inh_2d1d';
+end
+system([cmd ' output_phantom_nfft.dat ' ...
          int2str(N) ' ' int2str(M)  ' 3 1']);
 
 % Visualize the two dimensional phantom. Make a pic
@@ -62,7 +72,12 @@ visualize_data('pics/pic_2d1d', N, 1, 'Reconstruction considering the fieldmap')
 rms('pics/rms_2d1d.txt');
 
 % Reconstruct without considering the fieldmap
-system(['./reconstruct_data_2d ' 'output_phantom_nfft.dat ' ...
+if ispc
+    cmd='reconstruct_data_2d.exe';
+else 
+    cmd='./reconstruct_data_2d';
+end
+system([cmd ' output_phantom_nfft.dat ' ...
          int2str(N) ' ' int2str(M)  ' 3 1']);
 visualize_data('pics/pic_2d', N, 2, 'Inverse 2d-NFFT - 3. iteration');
 rms('pics/rms_2d.txt');
diff --git a/applications/mri/mri3d/mri.m b/applications/mri/mri3d/mri.m
index 361cc7c..d7b0604 100644
--- a/applications/mri/mri3d/mri.m
+++ b/applications/mri/mri3d/mri.m
@@ -34,7 +34,12 @@ M = construct_knots_spiral(N,Z);
 
 % First make N^2 1d-FFT, then Z 2d-NFFT on the constructed knots
 % and write the output to output_phantom_nfft.dat
-system(['./construct_data_2d1d ' 'output_phantom_nfft.dat '...
+if ispc
+    cmd='construct_data_2d1d.exe';
+else 
+    cmd='./construct_data_2d1d';
+end
+system([cmd ' output_phantom_nfft.dat '...
          int2str(N) ' ' int2str(M) ' ' int2str(Z)]);
 
 % Precompute the weights using voronoi cells
@@ -46,7 +51,12 @@ precompute_weights_2d('output_phantom_nfft.dat',M,Z);
 % The usage is "./reconstruct_data_2d1d filename N M Z ITER WEIGHTS"
 % where ITER is the number of iteration and WEIGHTS is 1
 % if the weights are used 0 else
-system(['./reconstruct_data_2d1d ' 'output_phantom_nfft.dat ' ...
+if ispc
+    cmd='reconstruct_data_2d1d.exe';
+else 
+    cmd='./reconstruct_data_2d1d';
+end
+system([cmd ' output_phantom_nfft.dat ' ...
          int2str(N) ' ' int2str(M) ' ' int2str(Z)  ' 3 1']);
 
 % Visualize the three dimensional phantom. Makes a pic of
@@ -61,7 +71,12 @@ visualize_data('pics_2+1d/pic', N, Z, 1, 'Inverse 2d1d-NFFT - 3. iteration - spi
 % The same as above but reconstructed with gridding.
 % That means first an adjoint 2d-NFFT, then a 1d-FFT.
 % The ITER parameter is obsolent and just for compatibility
-system(['./reconstruct_data_gridding ' 'output_phantom_nfft.dat ' ...
+if ispc
+    cmd='reconstruct_data_gridding.exe';
+else 
+    cmd='./reconstruct_data_gridding';
+end
+system([cmd ' output_phantom_nfft.dat ' ...
          int2str(N) ' ' int2str(M) ' ' int2str(Z)  ' 0 1']);
 visualize_data('pics_gridding/pic', N, Z, 2, 'Adjoint 2d1d-NFFT (Gridding) - spiral knots');
 rms('pics_gridding/rms.txt');
@@ -69,7 +84,12 @@ rms('pics_gridding/rms.txt');
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 % The same as above but reconstructed with a 3d-nfft
-system(['./reconstruct_data_3d ' 'output_phantom_nfft.dat ' ...
+if ispc
+    cmd='reconstruct_data_3d.exe';
+else 
+    cmd='./reconstruct_data_3d';
+end
+system([cmd ' output_phantom_nfft.dat ' ...
          int2str(N) ' ' int2str(M) ' ' int2str(Z)  ' 1 1']);
 visualize_data('pics_3d/pic', N, Z, 3, 'Inverse 3d-NFFT - 1. iteration - spiral knots');
 rms('pics_3d/rms.txt');
diff --git a/applications/polarFFT/fft_test.m b/applications/polarFFT/fft_test.m
index 8e96b43..673400d 100644
--- a/applications/polarFFT/fft_test.m
+++ b/applications/polarFFT/fft_test.m
@@ -25,7 +25,12 @@ save 'input_data_r.dat' fr -ascii -double
 save 'input_data_i.dat' fi -ascii -double
 
 
-system(sprintf('./polar_fft_test %d %d %d',N,T,R));
+if ispc
+    cmd='polar_fft_test.exe';
+else 
+    cmd='./polar_fft_test';
+end
+system(sprintf('%s %d %d %d',cmd,N,T,R));
 
 polar_fft_error = load('polar_fft_error.dat');
 polar_ifft_error3 = load('polar_ifft_error3.dat');
@@ -58,7 +63,12 @@ print fig_ipolar_fft -deps2
 disp(sprintf('\n'));
 
 
-system(sprintf('./mpolar_fft_test %d %d %d',N,T,R));
+if ispc
+    cmd_mpolar_fft_test='mpolar_fft_test.exe';
+else 
+    cmd_mpolar_fft_test='./mpolar_fft_test';
+end
+system(sprintf('%s %d %d %d',cmd_mpolar_fft_test,N,T,R));
 
 mpolar_fft_error = load('mpolar_fft_error.dat');
 mpolar_ifft_error3 = load('mpolar_ifft_error3.dat');
@@ -91,7 +101,12 @@ print fig_impolar_fft -deps2
 disp(sprintf('\n'));
 
 
-system(sprintf('./linogram_fft_test %d %d %d',N,T,R));
+if ispc
+    cmd_linogram_fft_test='linogram_fft_test.exe';
+else 
+    cmd_linogram_fft_test='./linogram_fft_test';
+end
+system(sprintf('%s %d %d %d',cmd_linogram_fft_test,N,T,R));
 
 linogram_fft_error = load('linogram_fft_error.dat');
 linogram_ifft_error3 = load('linogram_ifft_error3.dat');
diff --git a/applications/quadratureS2/quadratureS2.m b/applications/quadratureS2/quadratureS2.m
index 4ba210f..c44ad57 100644
--- a/applications/quadratureS2/quadratureS2.m
+++ b/applications/quadratureS2/quadratureS2.m
@@ -24,7 +24,11 @@ infilename = 'data.in';
 % The name of the output file
 outfilename = 'data.out';
 % The name of the program
-programname = 'quadratureS2';
+if ispc
+    programname='quadratureS2.exe';
+else 
+    programname='./quadratureS2';
+end
 
 % Display the menu.
 selection = menu('quadratureS2 - Fast evaluation of quadrature formulae on the sphere',...
@@ -122,7 +126,7 @@ fclose(file);
 
 fprintf('Program in execution. Please be patient! This may take a while!\n');
 
-system(sprintf('./%s < %s > %s',programname,infilename,outfilename));
+system(sprintf('%s < %s > %s',programname,infilename,outfilename));
 file = fopen(outfilename,'r');
 T = readTestcase(file);
 fclose(file);
diff --git a/applications/radon/radon.m b/applications/radon/radon.m
index 6220466..ff485f5 100644
--- a/applications/radon/radon.m
+++ b/applications/radon/radon.m
@@ -41,7 +41,12 @@ fwrite(fp,f','double');
 fclose(fp);
 
 %compute Radon transform by C-program
-system(sprintf('./radon %s %d %d %d',grid,N,T,R));
+if ispc
+    cmd='radon.exe';
+else 
+    cmd='./radon';
+end
+system(sprintf('%s %s %d %d %d',cmd,grid,N,T,R));
 
 %read result from file
 fp = fopen('sinogram_data.bin','rb+');
@@ -57,7 +62,12 @@ xlabel('angle');
 ylabel('offset');
 
 %compute inverse Radon transform by C-program
-system(sprintf('./inverse_radon %s %d %d %d %d',grid,N,T,R,it));
+if ispc
+    cmd='inverse_radon.exe';
+else 
+    cmd='./inverse_radon';
+end
+system(sprintf('%s %s %d %d %d %d',cmd,grid,N,T,R,it));
 
 %read result from file
 fp = fopen('output_data.bin','rb+');
diff --git a/applications/radon/ridgelet.m b/applications/radon/ridgelet.m
index 188e957..6e78726 100644
--- a/applications/radon/ridgelet.m
+++ b/applications/radon/ridgelet.m
@@ -69,7 +69,12 @@ axis image
 title(sprintf('noisy image (SNR=%g)',SNR));
 
 %compute Radon transform by C-program
-system(sprintf('./radon %s %d %d %d %d',grid,N,T,R));
+if ispc
+    cmd='radon.exe';
+else 
+    cmd='./radon';
+end
+system(sprintf('%s %s %d %d %d %d',cmd,grid,N,T,R));
 
 %read result from file
 fp = fopen('sinogram_data.bin','rb+');
@@ -94,7 +99,12 @@ fwrite(fp,Rf2d,'double');
 fclose(fp);
 
 %compute inverse Radon transform by C-program
-system(sprintf('./inverse_radon %s %d %d %d %d',grid,N,T,R,it));
+if ispc
+    cmd='inverse_radon.exe';
+else 
+    cmd='./inverse_radon';
+end
+system(sprintf('%s %s %d %d %d %d',cmd,grid,N,T,R,it));
 
 %read result
 fp = fopen('output_data.bin','rb+');
diff --git a/configure.ac b/configure.ac
index cba7186..af957a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,11 +18,23 @@
 # Process this file with autoconf to produce a configure script.
 ################################################################################
 
+m4_define([nfft_version_major], [3])
+m4_define([nfft_version_minor], [3])
+m4_define([nfft_version_patch], [1])
+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]))
+...
 # autoconf initialization
-AC_INIT([NFFT],[3.3.1],[mail at nfft.org])
+AC_INIT([NFFT],[NFFT_VERSION],[mail at nfft.org])
 
 # copyright notice
-AC_COPYRIGHT([2003, 2012, Jens Keiner, Stefan Kunis, Daniel Potts])
+AC_COPYRIGHT([2003, 2015, Jens Keiner, Stefan Kunis, Daniel Potts])
+
+AC_DEFINE_UNQUOTED([NFFT_VERSION_MAJOR], [nfft_version_major], [Major version number.])
+AC_DEFINE_UNQUOTED([NFFT_VERSION_MINOR], [nfft_version_minor], [Minor version number.])
+AC_DEFINE_UNQUOTED([NFFT_VERSION_PATCH], [nfft_version_patch], [Patch version number.])
+AC_DEFINE_UNQUOTED([NFFT_VERSION_TYPE], [nfft_version_type], [Release type.])
 
 # m4 macros go here
 AC_CONFIG_MACRO_DIR([m4])
diff --git a/examples/nfft/flags.m b/examples/nfft/flags.m
index 72fe33a..2c856d5 100644
--- a/examples/nfft/flags.m
+++ b/examples/nfft/flags.m
@@ -92,7 +92,12 @@ sigma_nfft2=8;
 sigma_taylor2=16;
 
 % typical sigma
-system(sprintf('./taylor_nfft %d %d %d %d %f %f > taylor_nfft2a.dat',1,first,...
+if ispc
+    cmd='taylor_nfft.exe';
+else 
+    cmd='./taylor_nfft';
+end
+system(sprintf('%s %d %d %d %d %f %f > taylor_nfft2a.dat',cmd,1,first,...
 	       last,trials,sigma_nfft,sigma_taylor));
 data=load('taylor_nfft2a.dat');
 
@@ -105,14 +110,14 @@ e_taylor=data(:,11);
 max_e_taylor=(max(reshape(e_taylor,trials,last-first+1)))';
 
 % small sigma
-system(sprintf('./taylor_nfft %d %d %d %d %f %f > taylor_nfft2b.dat',1,first,...
+system(sprintf('%s %d %d %d %d %f %f > taylor_nfft2b.dat',cmd,1,first,...
 	       last,trials,sigma_nfft1,sigma_taylor1));
 data1=load('taylor_nfft2b.dat');
 max_e_nfft_sigma=(max(reshape(data1(:,7),trials,last-first+1)))';
 max_e_taylor_sigma=(max(reshape(data1(:,11),trials,last-first+1)))';
 
 % large sigma
-system(sprintf('./taylor_nfft %d %d %d %d %f %f > taylor_nfft2c.dat',1,first,...
+system(sprintf('%s %d %d %d %d %f %f > taylor_nfft2c.dat',cmd,1,first,...
 	       last,trials,sigma_nfft2,sigma_taylor2));
 data2=load('taylor_nfft2c.dat');
 max_e_nfft_sigma2=(max(reshape(data2(:,7),trials,last-first+1)))';
diff --git a/examples/nfft/simple_test_threads.c.in b/examples/nfft/simple_test_threads.c.in
index a2554e5..9790e1b 100644
--- a/examples/nfft/simple_test_threads.c.in
+++ b/examples/nfft/simple_test_threads.c.in
@@ -34,7 +34,7 @@ int main(void)
   const int M = 1000000;
   NFFT_R t0, t1;
 
-  printf("nthreads = %td\n", NFFT(get_num_threads)());
+  printf("nthreads = " NFFT__D__ "\n", NFFT(get_num_threads)());
 
   /* init */
   FFTW(init_threads)();
diff --git a/examples/nfft/taylor_nfft.c b/examples/nfft/taylor_nfft.c
index ab752ce..8000a87 100644
--- a/examples/nfft/taylor_nfft.c
+++ b/examples/nfft/taylor_nfft.c
@@ -234,7 +234,7 @@ static void taylor_time_accuracy(int N, int M, int n, int m, int n_taylor,
     printf("%.2" __FES__ "\t", t_ndft);
   }
   else
-    printf("N/A\t\t");
+    printf("NaN\t");
 
   /* NFFT */
   t_nfft = K(0.0);
@@ -255,7 +255,7 @@ static void taylor_time_accuracy(int N, int M, int n, int m, int n_taylor,
   if (test_accuracy)
     printf("%.2" __FES__ "\t", NFFT(error_l_infty_complex)(swapndft, np.f, np.M_total));
   else
-    printf("N/A\t\t");
+    printf("NaN\t");
 
   /** TAYLOR NFFT */
   t_taylor = K(0.0);
@@ -276,7 +276,7 @@ static void taylor_time_accuracy(int N, int M, int n, int m, int n_taylor,
   if (test_accuracy)
     printf("%.2" __FES__ "\n", NFFT(error_l_infty_complex)(swapndft, np.f, np.M_total));
   else
-    printf("N/A\t\n");
+    printf("NaN\n");
 
   fflush(stdout);
 
diff --git a/examples/nfft/taylor_nfft.m b/examples/nfft/taylor_nfft.m
index 0af3350..052e164 100644
--- a/examples/nfft/taylor_nfft.m
+++ b/examples/nfft/taylor_nfft.m
@@ -32,7 +32,12 @@ to_pdf=0;
 trials=10;
 first=4;
 last=22;
-system(sprintf('./taylor_nfft %d %d %d %d %f %f > taylor_nfft.data0',0,first,last,trials,2,4));
+if ispc
+    cmd='taylor_nfft.exe';
+else 
+    cmd='./taylor_nfft';
+end
+system(sprintf('%s %d %d %d %d %f %f > taylor_nfft.data0',cmd,0,first,last,trials,2,4));
 data=load('taylor_nfft.data0');
 
 N=data(1:trials:end,1);
@@ -71,7 +76,7 @@ sigma_nfft_c=16;
 sigma_taylor_c=16;
 
 % typical sigma
-system(sprintf('./taylor_nfft %d %d %d %d %f %f > taylor_nfft.data1a',1,first,...
+system(sprintf('%s %d %d %d %d %f %f > taylor_nfft.data1a',cmd,1,first,...
 	       last,trials,sigma_nfft_a,sigma_taylor_a));
 data=load('taylor_nfft.data1a');
 
@@ -84,7 +89,7 @@ e_taylor_a=(max(reshape(data(:,11),trials,last-first+1)))';
 t_taylor_a=(mean(reshape(data(:,10),trials,last-first+1)))';
 
 % small sigma
-system(sprintf('./taylor_nfft %d %d %d %d %f %f > taylor_nfft.data1b',1,first,...
+system(sprintf('%s %d %d %d %d %f %f > taylor_nfft.data1b',cmd,1,first,...
 	       last,trials,sigma_nfft_b,sigma_taylor_b));
 data=load('taylor_nfft.data1b');
 
@@ -92,7 +97,7 @@ e_nfft_b=(max(reshape(data1(:,7),trials,last-first+1)))';
 e_taylor_b=(max(reshape(data1(:,11),trials,last-first+1)))';
 
 % large sigma
-system(sprintf('./taylor_nfft %d %d %d %d %f %f > taylor_nfft.data1c',1,first,...
+system(sprintf('%s %d %d %d %d %f %f > taylor_nfft.data1c',cmd,1,first,...
 	       last,trials,sigma_nfft_c,sigma_taylor_c));
 data=load('taylor_nfft.data1c');
 
diff --git a/examples/solver/glacier.m b/examples/solver/glacier.m
index 0251576..ab445b3 100644
--- a/examples/solver/glacier.m
+++ b/examples/solver/glacier.m
@@ -29,7 +29,12 @@ input_data(:,2)=(input_data(:,2)-min(input_data(:,2))) /y_range*(1-2*border_eps)
 
 save input_data.dat -ascii -double -tabs input_data
 
-system(sprintf('./glacier %d %d > output_data.dat',N,M));
+if ispc
+    cmd='glacier.exe';
+else 
+    cmd='./glacier';
+end
+system(sprintf('%s %d %d > output_data.dat',cmd,N,M));
 
 load output_data.dat
 f_hat=output_data(:,1)+i*output_data(:,2);
diff --git a/examples/solver/glacier_cv.m b/examples/solver/glacier_cv.m
index 40ecf85..3fb9017 100644
--- a/examples/solver/glacier_cv.m
+++ b/examples/solver/glacier_cv.m
@@ -37,4 +37,9 @@ M_cv_end=1000;
 
 save input_data.dat -ascii -double -tabs input_data
 
-system(sprintf('./glacier %d %d %d %d %d > output_data_cv.tex',N,M,M_cv_start,M_cv_step,M_cv_end));
+if ispc
+    cmd='glacier.exe';
+else 
+    cmd='./glacier';
+end
+system(sprintf('%s %d %d %d %d %d > output_data_cv.tex',cmd,N,M,M_cv_start,M_cv_step,M_cv_end));
diff --git a/include/infft.h b/include/infft.h
index e02c281..2d0940e 100644
--- a/include/infft.h
+++ b/include/infft.h
@@ -1300,27 +1300,31 @@ extern double _Complex catanh(double _Complex z);
 #  define __FE__ "% 36.32LE"
 #  define __FI__ "%Lf"
 #  define __FIS__ "Lf"
-#  define __FR__ "%La"
+#  define __FR__ "%Le"
 #elif defined(NFFT_SINGLE)
 #  define __FGS__ "g"
 #  define __FES__ "E"
 #  define __FE__ "% 12.8E"
 #  define __FI__ "%f"
 #  define __FIS__ "f"
-#  define __FR__ "%a"
+#  define __FR__ "%e"
 #else
 #  define __FGS__ "lg"
 #  define __FES__ "lE"
 #  define __FE__ "% 20.16lE"
 #  define __FI__ "%lf"
 #  define __FIS__ "lf"
-#  define __FR__ "%la"
+#  define __FR__ "%le"
 #endif
 
 #define TRUE 1
 #define FALSE 0
 
-#define __D__ "%td"
+#if defined(_WIN32) || defined(_WIN64)
+#  define __D__ "%Id"
+#else
+#  define __D__ "%td"
+#endif
 
 /** Dummy use of unused parameters to silence compiler warnings */
 #define UNUSED(x) (void)x
diff --git a/include/nfft3.h b/include/nfft3.h
index eade869..e2a44d3 100644
--- a/include/nfft3.h
+++ b/include/nfft3.h
@@ -876,8 +876,8 @@ R Y(dot_complex)(C *x, NFFT_INT n); \
 void Y(upd_axpy_complex)(C *x, R a, C *y, NFFT_INT n); \
 /** Swaps each half over N[d]/2. */ \
 void Y(fftshift_complex)(C *x, NFFT_INT d, NFFT_INT* N); \
-void Y(fftshift_complex_int)(C *x, int d, int* N);
-
+void Y(fftshift_complex_int)(C *x, int d, int* N); \
+void Y(get_version)(unsigned *major, unsigned *minor, unsigned *patch);
 
 NFFT_DEFINE_UTIL_API(NFFT_MANGLE_FLOAT,float,fftwf_complex)
 NFFT_DEFINE_UTIL_API(NFFT_MANGLE_DOUBLE,double,fftw_complex)
diff --git a/include/nfft3mp.h b/include/nfft3mp.h
index 8222e31..de707c8 100644
--- a/include/nfft3mp.h
+++ b/include/nfft3mp.h
@@ -70,21 +70,21 @@ typedef double _Complex NFFT_C;
 #  define NFFT__FE__ "% 36.32LE"
 #  define NFFT__FI__ "%Lf"
 #  define NFFT__FIS__ "Lf"
-#  define NFFT__FR__ "%La"
+#  define NFFT__FR__ "%Le"
 #elif defined(NFFT_PRECISION_SINGLE)
 #  define NFFT__FGS__ "g"
 #  define NFFT__FES__ "E"
 #  define NFFT__FE__ "% 12.8E"
 #  define NFFT__FI__ "%f"
 #  define NFFT__FIS__ "f"
-#  define NFFT__FR__ "%a"
+#  define NFFT__FR__ "%e"
 #elif defined(NFFT_PRECISION_DOUBLE)
 #  define NFFT__FGS__ "lg"
 #  define NFFT__FES__ "lE"
 #  define NFFT__FE__ "% 20.16lE"
 #  define NFFT__FI__ "%lf"
 #  define NFFT__FIS__ "lf"
-#  define NFFT__FR__ "%la"
+#  define NFFT__FR__ "%le"
 #else
 #error Either define macro NFFT_PRECISION_SINGLE, NFFT_PRECISION_DOUBLE or NFFT_PRECISION_LONG_DOUBLE for single, double or long double precision
 #endif
@@ -99,4 +99,10 @@ typedef double _Complex NFFT_C;
 
 #define NFFT_KPI NFFT_K(3.1415926535897932384626433832795028841971693993751)
 
+#if defined(_WIN32) || defined(_WIN64)
+#  define NFFT__D__ "%Id"
+#else
+#  define NFFT__D__ "%td"
+#endif
+
 #endif /* defined(__NFFT3MP_H__) */
diff --git a/kernel/util/Makefile.am b/kernel/util/Makefile.am
index d8c9668..4952f0d 100644
--- a/kernel/util/Makefile.am
+++ b/kernel/util/Makefile.am
@@ -7,7 +7,7 @@ else
 endif
 
 noinst_LTLIBRARIES = libutil.la $(LIBUTIL_THREADS_LA)
-libutil_la_SOURCES = malloc.c sinc.c lambda.c bessel_i0.c float.c int.c error.c bspline.c assert.c sort.c rand.c vector1.c vector2.c vector3.c print.c voronoi.c damp.c thread.c time.c window.c
+libutil_la_SOURCES = malloc.c sinc.c lambda.c bessel_i0.c float.c int.c error.c bspline.c assert.c sort.c rand.c vector1.c vector2.c vector3.c print.c voronoi.c damp.c thread.c time.c window.c version.c
 
 if HAVE_THREADS
   libutil_threads_la_SOURCES = $(libutil_la_SOURCES)
diff --git a/kernel/util/bspline.c b/kernel/util/bspline.c
index 77c5774..c21c0ee 100644
--- a/kernel/util/bspline.c
+++ b/kernel/util/bspline.c
@@ -57,15 +57,9 @@ R Y(bsplines)(const INT k, const R _x)
 
     r = (INT)LRINT(CEIL(x) - K(1.0));
 
-    /* Explicit case for first interval. */
-    if (r == 0)
-    {
-      result_value = K(1.0);
-      for (j = 0; j < k - 1; j++)
-        result_value *= x/((R)(j+1));
-      return result_value;
-    }
-
+    /* Do not use the explicit formula x^k / k! for first interval! De Boor's
+     * algorithm is more accurate. See https://github.com/NFFT/nfft/issues/16.
+     */
 
     for (idx = 0; idx < k; idx++)
       scratch[idx] = K(0.0);
diff --git a/kernel/util/version.c b/kernel/util/version.c
new file mode 100644
index 0000000..753085c
--- /dev/null
+++ b/kernel/util/version.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2002, 2016 Jens Keiner, Stefan Kunis, Daniel Potts
+ *
+ * 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 "api.h"
+
+void Y(get_version)(unsigned *major, unsigned *minor, unsigned *patch)
+{
+    major[0] = NFFT_VERSION_MAJOR;
+    minor[0] = NFFT_VERSION_MINOR;
+    patch[0] = NFFT_VERSION_PATCH;
+}
diff --git a/m4/ax_prog_matlab.m4 b/m4/ax_prog_matlab.m4
index 2039196..34a32e3 100644
--- a/m4/ax_prog_matlab.m4
+++ b/m4/ax_prog_matlab.m4
@@ -241,7 +241,7 @@ AC_DEFUN([AX_PROG_MATLAB],
     saved_LIBS="$LIBS"
     saved_LDFLAGS="$LDFLAGS"
 
-    for matlab_fftw3_lib_name in mwfftw3 fftw3; do
+    for matlab_fftw3_lib_name in mwfftw3 :libmwfftw3.so.3 fftw3; do
       matlab_fftw3_LIBS="-l${matlab_fftw3_lib_name}"
       LIBS="-l${matlab_fftw3_lib_name} $LIBS"
       LDFLAGS="-L$matlab_fftw3_lib_dir ${matlab_LDFLAGS} $LDFLAGS"
@@ -266,7 +266,7 @@ AC_DEFUN([AX_PROG_MATLAB],
       fi
 
       if test "x$ax_matlab_lib_fftw3" = "xno"; then
-        AC_MSG_ERROR([You don't seem to have installed the FFTW 3 libray for the NFFT Matlab interface.])
+        continue
       fi
 
       if test "x$matlab_threads" = "xyes"; then
@@ -300,7 +300,7 @@ AC_DEFUN([AX_PROG_MATLAB],
         fi
 
         if test "x$ax_matlab_lib_fftw3_threads" = "xno"; then
-          AC_MSG_ERROR([You don't seem to have installed the FFTW 3 libray for the NFFT Matlab interface.])
+          continue
         fi
       fi
 
@@ -309,6 +309,14 @@ AC_DEFUN([AX_PROG_MATLAB],
       fi
     done
 
+    if test "x$ax_matlab_lib_fftw3" = "xno"; then
+      AC_MSG_ERROR([You don't seem to have installed the FFTW 3 libray for the NFFT Matlab interface.])
+    fi
+
+    if test "x$matlab_threads" = "xyes" -a "x$ax_matlab_lib_fftw3_threads" = "xno"; then
+      AC_MSG_ERROR([You don't seem to have installed the threaded FFTW 3 libray for the NFFT Matlab interface.])
+    fi
+
     LIBS="$saved_LIBS"
     LDFLAGS="$saved_LDFLAGS"
   fi
diff --git a/matlab/Makefile.am b/matlab/Makefile.am
index 0ef0918..0828b90 100644
--- a/matlab/Makefile.am
+++ b/matlab/Makefile.am
@@ -11,7 +11,12 @@ else
 endif
 
 DIR_NFFT=nfft
-DIR_NNFFT=nnfft
+
+if HAVE_NNFFT
+  DIR_NNFFT=nnfft
+else
+  DIR_NNFFT=
+endif
 
 SUBDIRS = . $(DIR_NFFT) $(DIR_NFSFT) $(DIR_NFSOFT) $(DIR_NNFFT)
 
diff --git a/tests/bspline.c b/tests/bspline.c
index ee012ca..8c19e94 100644
--- a/tests/bspline.c
+++ b/tests/bspline.c
@@ -6320,7 +6320,7 @@ static const R b30[] =
   K(0.24684163539601499376496292031270154746415289827073608174217318),
 };
 
-#define ERR(x,y) IF(ABS(x - y) == K(0.0), ABS(x - y), ABS(x - y) / ABS(y))
+#define ERR(x,y) IF(ABS(y) == K(0.0), ABS(x - y), ABS(x - y) / ABS(y))
 
 #if defined(NFFT_LDOUBLE)
 static const R bound = K(16.0) * EPSILON;
diff --git a/tests/nfft.c b/tests/nfft.c
index 1a26bdc..436b1a8 100644
--- a/tests/nfft.c
+++ b/tests/nfft.c
@@ -412,7 +412,7 @@ static void setup_file(const testcase_delegate_t *ego_, int *d, int **N, int *NN
   printf(" M = %-5d", *M);
 
 #ifdef _OPENMP
-  printf(" nthreads = %td", X(get_num_threads)());
+  printf(" nthreads = " __D__, X(get_num_threads)());
 #endif
 
   for (j = 0, *NN = 1; j < *d; j++)
@@ -485,7 +485,7 @@ static void setup_online(const testcase_delegate_t *ego_, int *d, int **N, int *
   printf(" M = %-5d", *M);
 
 #ifdef _OPENMP
-  printf(" nthreads = %td", X(get_num_threads)());
+  printf(" nthreads = " __D__, X(get_num_threads)());
 #endif
 
   for (j = 0, *NN = 1; j < *d; j++)
@@ -573,7 +573,7 @@ static void setup_adjoint_online(const testcase_delegate_t *ego_, int *d, int **
   printf(" M = %-5d", *M);
 
 #ifdef _OPENMP
-  printf(" nthreads = %td", X(get_num_threads)());
+  printf(" nthreads = " __D__, X(get_num_threads)());
 #endif
 
   for (j = 0, *NN = 1; j < *d; j++)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/nfft.git



More information about the debian-science-commits mailing list