[nfft] 01/04: Imported Upstream version 3.3.2~rc1
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Sat May 28 14:39:33 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/master
in repository nfft.
commit aa841905dfa3066168b5f4b32ffdb64ae47211d8
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date: Thu May 26 07:33:17 2016 +0100
Imported Upstream version 3.3.2~rc1
---
.travis.yml | 6 ++---
bootstrap.sh | 2 +-
configure.ac | 6 ++++-
include/infft.h | 11 ---------
kernel/util/bessel_i0.c | 63 +++++++++++++++++++++++++++++++++++++++++++++----
support/Portfile | 6 ++---
tests/bessel.c | 2 +-
tests/bspline.c | 2 +-
tests/nfct.c | 23 +++++++++---------
tests/nfft.c | 27 +++++++++++----------
tests/nfst.c | 27 +++++++++++----------
11 files changed, 113 insertions(+), 62 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 90d07ab..a7e4cdd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,8 +26,8 @@ env:
- 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//./ } );
+ NFFT_TRAVIS_TAG=$(sed -e 's/\([0-9]*\.[0-9]*\.[0-9]*\)\(.*\)/\1.\2/' <<< "$TRAVIS_TAG");
+ a=( ${NFFT_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;
@@ -50,6 +50,6 @@ deploy:
file: ${NFFT_DISTRO}
skip_cleanup: true
on:
- condition: $DIST = dist
+ condition: $DIST = dist && $CC = clang
tags: true
repo: NFFT/nfft
diff --git a/bootstrap.sh b/bootstrap.sh
index 3aed96e..4241b31 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Copyright (c) 2003, 2006 Matteo Frigo
# Copyright (c) 2003, 2006 Massachusetts Institute of Technology
diff --git a/configure.ac b/configure.ac
index af957a9..fe979f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,7 +57,11 @@ AC_CANONICAL_HOST
# substitute abs_srcdir in generated Makefiles.
AC_SUBST([abs_srcdir])
-AC_DEFINE_UNQUOTED([ABS_SRCDIR], ["`pwd`/$srcdir"], [Absolute path to source directory.])
+if test "x${host_os}" = "xmingw32" -o "x${host_os}" = "xmingw64"; then
+ AC_DEFINE_UNQUOTED([ABS_SRCDIR], ["`pwd -W`/$srcdir"], [Absolute path to source directory.])
+else
+ AC_DEFINE_UNQUOTED([ABS_SRCDIR], ["`pwd`/$srcdir"], [Absolute path to source directory.])
+fi
AC_SUBST([abs_top_srcdir])
AC_SUBST([top_builddir])
diff --git a/include/infft.h b/include/infft.h
index 2d0940e..9f17f7a 100644
--- a/include/infft.h
+++ b/include/infft.h
@@ -115,17 +115,6 @@ typedef double _Complex C;
# define __CYGWIN__ __CYGWIN32__
#endif
-#if defined _WIN32 && !defined __CYGWIN__
- /* Use Windows separators on all _WIN32 defining
- environments, except Cygwin. */
-# define SEP "\\"
-#endif
-#ifndef SEP
- /* Assume that not having this is an indicator that all
- are missing. */
-# define SEP "/"
-#endif /* !DIR_SEPARATOR_CHAR */
-
/* Integral type large enough to contain a stride (what ``int'' should have been
* in the first place) */
typedef ptrdiff_t INT;
diff --git a/kernel/util/bessel_i0.c b/kernel/util/bessel_i0.c
index c6b3e24..d7673e8 100644
--- a/kernel/util/bessel_i0.c
+++ b/kernel/util/bessel_i0.c
@@ -23,7 +23,7 @@
/* long double 128 bit wide */
static const R P1[] =
{
- K(1.00715709113717408460589579223209941204261347125985390244049122),
+/* K(1.00715709113717408460589579223209941204261347125985390244049122),
K(0.244951997023176876020320575838917179801959212259109588711443322),
K(0.007157677421552158878119583351756319398653762265084335703499437),
K(0.000088638803372684623765617528646130117285577351082745565226135),
@@ -39,11 +39,25 @@
K(3.9925388022711127965090640127e-34),
K(6.9368410036374068977799409e-38),
K(7.357454531748581565018e-42),
- K(3.62204101214442072e-46),
+ K(3.62204101214442072e-46),*/
+ K(0.9999999999999999999999999999999999999999963515065921354497623928177244792974547753040696048019993068306675177598294917679926543),
+ K(0.24276955985311678830288083577293544704012354683319145630709103400802420412620905478538554110386082548028866764933663319841013742),
+ K(0.013844000842246463336843317193621339855944831486655409125072546540606366090450490190063651171448141102105390267023313455494802031),
+ K(0.00032763845166349779609624476806643905692244330767883713044114956959726110588033852488576786498440206723959034484117143043714211872),
+ K(4.04278885380813770024807051634824441153887632161345065929233320635142375490984393216297506314781705551344035216665454332238235e-6),
+ K(2.9325743226756448326703947080260081389259160960470915792249652053458431219164897298629105406427758884445334480365543323669142762e-8),
+ K(1.3416945462493443207573100874446091344709631116863657704764416440229805215129727891601536132878669919905709392817394894494425677e-10),
+ K(4.0371971250467042974736443967244346562054293605112799970377213755073446077415709659054361024114190831360613645387670633846568544e-13),
+ K(8.1678797936139235907848459949161332792483634497971529272331873214695723482690572892077603647732164105505823130495158062801046885e-16),
+ K(1.1165878793312910647478353889670801840459072972272122299134924612830770907089313712476063043251498513091899193529937985402078293e-18),
+ K(1.0169264578489866422787383175800265073817756845613863091789102925882053694431068354556850955496203485982689612448409358037117224e-21),
+ K(5.9142741273023781136631333449369758009797135719841659345768586480313343614241803535448993719207666398407854710005136444504735373e-25),
+ K(1.9897807089898986657009220458155311224877079439590225847312210818955629435772271187048354122731017832435358317884079274114350597e-28),
+ K(2.9530812783305899252122293177156565148483175841218970825603396228881503512715581471598172039269397955931595227424211384966216511e-32),
};
static const R Q1[] =
{
- K(1.000007070784273109528051454385187718969110645914059499666326971665),
+ /*K(1.000007070784273109528051454385187718969110645914059499666326971665),
K(-0.005313926453449002844879821442805584438144938596471790433918964154),
K(7.070788418542362565462155969863941136682888242514039780835548e-6),
K(-6.26540971437695808708857953483635930152829451235344028056e-9),
@@ -59,7 +73,29 @@
K(-2.4019827304263718078055e-44),
K(2.329008315410200325e-48),
K(-1.5351885198203e-52),
- K(5.185989964e-57),
+ K(5.185989964e-57),*/
+ K(1),
+ K(-0.007230440146883211697119164227064552959940469601802150267743902983950633225740330555568499761006523145220060365617298575094972364),
+ K(0.000026610878967266261123108250387478096107767403703098829324400402789773733036278358942208368636230110552954724959336237423334611354),
+ K(-6.6418561046364194823131260324605071971736768593116331036743492617164346537067017078667860850205389434338539132171418303552823641e-8),
+ K(1.2635173536516244659083712181830860254951317797951697889315997192717623908334183898523633919285989474010384847783329982632172733e-10),
+ K(-1.9517346807463823741843626600230023016243596738590561462886629288968714083439872722087483091272116306494280458539104079877963867e-13),
+ K(2.5459600708465926950568822248200620423992132521259083910226347336222666927639065909493751131398894251614012646995410744015559072e-16),
+ K(-2.8790218876160776506148097182123491633858030422401313378350393848406759730467694280467887294892944770215457791589036549542194809e-19),
+ K(2.8738884119239095061588791219478165718008910893684665211335982689627174926584039000157382606089292467623099246542063585502730545e-22),
+ K(-2.5644755191632550113321700287923019423704601492756985611529511459673947528784204294165642982187400805362843756251316630197171617e-25),
+ K(2.0630019070002105495983927614425566607750872558325302074182464328391656962221421552530098790143235472950584190081781381635126635e-28),
+ K(-1.5036541536186884008079051856308703738223209609730328195575520395541903540554854682218673228471525989874850952368884748950691195e-31),
+ K(9.9483378830871614794714300624683404078126644061648067673976795037385419799614706160677430487801547129197617194653848496972860448e-35),
+ K(-5.9666072338595577136675685567379621640652365858136833276048183536646869001300548323677693849740241191969161925507470584091020584e-38),
+ K(3.2281028151284542036169429498006402237378996543942470437138237045380783628834109543661443253176467830392497005208834688479362203e-41),
+ K(-1.5609087004678718448649634494155339624833103667184112471336868908855917869938809716149630194765597509071088580980485176246671792e-44),
+ K(6.6442791370456417706879995929001251138613704220713466640453318576286491971798462000027629043082409996804243977262775241716469185e-48),
+ K(-2.4316502070204632324531926290052001071369167680891484995765974380869029745472241953227653321482690388081421033279879605300878605e-51),
+ K(7.3718663976068509458216002032719538491642327044087760501859950135169216959756295014557221276386055532269835887246143354291263258e-55),
+ K(-1.7402063031722075308972216386755603097203276298684716386056631858675960072536233015088697443420074462290323581370737416680264926e-58),
+ K(2.8480300407821398144958972563451588416708146926635758589735999654660638025080500841891165268477538943982713226240517522905931531e-62),
+ K(-2.4252997561052839868467014562745507777332139979018019792999864063820565601738471968013560629065587192404418964874082120251773035e-66),
};
static const R P2[] =
{
@@ -289,6 +325,21 @@ static inline R evaluate_chebyshev(const INT n, const R *c, const R x)
return a + x * b;
}
+static inline R evaluate_polynomial(const INT n, const R *c, const R x)
+{
+ R r = c[n-1];
+ INT j;
+
+ A(n >= 2);
+
+ for (j = n - 2; j >= 0; j--)
+ {
+ r = r * x + c[j];
+ }
+
+ return r;
+}
+
R Y(bessel_i0)(R x)
{
if (x < 0)
@@ -304,7 +355,11 @@ R Y(bessel_i0)(R x)
{
/* x in (0, 15] */
const R y = x * x;
+#if defined(NFFT_LDOUBLE) && LDBL_MANT_DIG > 64
+ return evaluate_polynomial(N1, P1, y) / evaluate_polynomial(M1, Q1, y);
+#else
return evaluate_chebyshev(N1, P1, y) / evaluate_chebyshev(M1, Q1, y);
+#endif
}
else
{
diff --git a/support/Portfile b/support/Portfile
index 9a6632d..a5be6a1 100644
--- a/support/Portfile
+++ b/support/Portfile
@@ -35,9 +35,9 @@ long_description NFFT3 is a software library written in C for computing noneq
* zonal kernels \n\
- polar FFT, discrete Radon transform, ridgelet transform
homepage http://www.nfft.org
-master_sites https://www-user.tu-chemnitz.de/~potts/nfft/download/
-checksums rmd160 52cac61a90a72bb25a91b3aa0d1b1692d1895e26 \
- sha256 bb844b762896b17b7bf8245511a6372fcef82e55c2552f2f7ee7c65a8d746f30
+master_sites https://github.com/NFFT/nfft/releases/download/${version}/
+checksums rmd160 08b4ff6b8d35b2ebc90159a8e86ff400e565528c \
+ sha256 74cc7f4c8922d72131c59f88ecb542e06254eaded09018d6367f8a46c0fb3125
depends_lib port:fftw-3
use_autoreconf no
configure.args --enable-shared --enable-static --enable-all
diff --git a/tests/bessel.c b/tests/bessel.c
index 72a4fc3..51a87fa 100644
--- a/tests/bessel.c
+++ b/tests/bessel.c
@@ -137,7 +137,7 @@ static const R r[] =
#if defined(NFFT_LDOUBLE)
static const R bound = K(58.0) * EPSILON;
#elif defined(NFFT_SINGLE)
-static const R bound = K(14.0) * EPSILON;
+static const R bound = K(16.0) * EPSILON;
#else
static const R bound = K(4.0) * EPSILON;
#endif
diff --git a/tests/bspline.c b/tests/bspline.c
index 8c19e94..357eeb8 100644
--- a/tests/bspline.c
+++ b/tests/bspline.c
@@ -6323,7 +6323,7 @@ static const R b30[] =
#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;
+static const R bound = K(17.0) * EPSILON;
#elif defined(NFFT_SINGLE)
static const R bound = K(20.0) * EPSILON;
#else
diff --git a/tests/nfct.c b/tests/nfct.c
index 475bb34..31a3c13 100644
--- a/tests/nfct.c
+++ b/tests/nfct.c
@@ -29,7 +29,7 @@
#include "cycle.h"
#include "nfct.h"
-#define ABSPATH(x) ABS_SRCDIR SEP "tests" SEP x
+#define ABSPATH(x) ABS_SRCDIR "/tests/" x
/* Testcase delegate. */
typedef struct testcase_delegate_s testcase_delegate_t;
@@ -189,7 +189,7 @@ static R trafo_direct_cost(X(plan) *p)
x += 1;
}
X(finalize)(&p2);
- free(N);
+ Y(free)(N);
}
}
}
@@ -380,11 +380,12 @@ static void setup_file(const testcase_delegate_t *ego_, int *d, int **N, int *NN
const testcase_delegate_file_t *ego = (const testcase_delegate_file_t*)ego_;
int j;
char filename[200];
- char* c = rindex(ego->filename, SEP[0]);
+ char* c = strrchr(ego->filename, '/');
FILE *file = fopen(ego->filename, "r");
filename[0] = (char) 0;
- strcpy(filename, &c[1]);
+ strncpy(filename, &c[1], 200);
+ filename[199] = (char) 0;
printf("%-31s", filename);
/* Dimensions. */
@@ -444,9 +445,9 @@ static void setup_file(const testcase_delegate_t *ego_, int *d, int **N, int *NN
static void destroy_file(const testcase_delegate_t *ego_, R *x, R *f_hat, R *f)
{
UNUSED(ego_);
- free(x);
- free(f_hat);
- free(f);
+ Y(free)(x);
+ Y(free)(f_hat);
+ Y(free)(f);
}
static void setup_online(const testcase_delegate_t *ego_, int *d, int **N, int *NN, int *M, R **x, R **f_hat, R **f)
@@ -619,9 +620,9 @@ static void setup_adjoint_online(const testcase_delegate_t *ego_, int *d, int **
static void destroy_online(const testcase_delegate_t *ego_, R *x, R *f_hat, R *f)
{
UNUSED(ego_);
- free(x);
- free(f_hat);
- free(f);
+ Y(free)(x);
+ Y(free)(f_hat);
+ Y(free)(f);
}
/* Initializers. */
@@ -659,7 +660,7 @@ static void init_advanced_pre_psi_(init_delegate_t *ego, X(plan) *p, const int d
for (i = 0; i < d; i++)
n[i] = 2 * (int)(Y(next_power_of_2)(N[i]));
X(init_guru)(p, d, N, M, n, ego->m, ego->flags, ego->fftw_flags);
- free(n);
+ Y(free)(n);
}
static init_delegate_t init_direct = {"init_guru ()", init_advanced_pre_psi_, WINDOW_HELP_ESTIMATE_m, (DEFAULT_NFFT_FLAGS ^ PRE_PSI), DEFAULT_FFTW_FLAGS};
diff --git a/tests/nfft.c b/tests/nfft.c
index 436b1a8..ed68a97 100644
--- a/tests/nfft.c
+++ b/tests/nfft.c
@@ -29,7 +29,7 @@
#include "cycle.h"
#include "nfft.h"
-#define ABSPATH(x) ABS_SRCDIR SEP "tests" SEP x
+#define ABSPATH(x) ABS_SRCDIR "/tests/" x
/* Testcase delegate. */
typedef struct testcase_delegate_s testcase_delegate_t;
@@ -190,7 +190,7 @@ static R trafo_direct_cost(X(plan) *p)
x += 1;
}
X(finalize)(&p2);
- free(N);
+ Y(free)(N);
}
}
}
@@ -211,7 +211,7 @@ static R trafo_direct_cost(X(plan) *p)
static R err_trafo_direct(X(plan) *p)
{
UNUSED(p);
- return K(40.0) * EPSILON;
+ return K(44.0) * EPSILON;
}
static R err_trafo(X(plan) *p)
@@ -381,11 +381,12 @@ static void setup_file(const testcase_delegate_t *ego_, int *d, int **N, int *NN
const testcase_delegate_file_t *ego = (const testcase_delegate_file_t*)ego_;
int j;
char filename[200];
- char* c = rindex(ego->filename, SEP[0]);
+ char* c = strrchr(ego->filename, '/');
FILE *file = fopen(ego->filename, "r");
filename[0] = (char) 0;
- strcpy(filename, &c[1]);
+ strncpy(filename, &c[1], 200);
+ filename[199] = (char) 0;
printf("%-31s", filename);
/* Dimensions. */
@@ -449,9 +450,9 @@ static void setup_file(const testcase_delegate_t *ego_, int *d, int **N, int *NN
static void destroy_file(const testcase_delegate_t *ego_, R *x, C *f_hat, C *f)
{
UNUSED(ego_);
- free(x);
- free(f_hat);
- free(f);
+ Y(free)(x);
+ Y(free)(f_hat);
+ Y(free)(f);
}
static void setup_online(const testcase_delegate_t *ego_, int *d, int **N, int *NN, int *M, R **x, C **f_hat, C **f)
@@ -632,9 +633,9 @@ static void setup_adjoint_online(const testcase_delegate_t *ego_, int *d, int **
static void destroy_online(const testcase_delegate_t *ego_, R *x, C *f_hat, C *f)
{
UNUSED(ego_);
- free(x);
- free(f_hat);
- free(f);
+ Y(free)(x);
+ Y(free)(f_hat);
+ Y(free)(f);
}
/* Initializers. */
@@ -672,7 +673,7 @@ static void init_advanced_pre_psi_(init_delegate_t *ego, X(plan) *p, const int d
for (i = 0; i < d; i++)
n[i] = 2 * (int)(Y(next_power_of_2)(N[i]));
X(init_guru)(p, d, N, M, n, ego->m, ego->flags, ego->fftw_flags);
- free(n);
+ Y(free)(n);
}
//static void init_advanced_pre_lin_psi_(init_delegate_t *ego, X(plan) *p, const int d, const int *N, const int M)
@@ -684,7 +685,7 @@ static void init_advanced_pre_psi_(init_delegate_t *ego, X(plan) *p, const int d
// int K = ego->K * (ego->m + 2);
// //printf("\n%d\n", K);
// X(init_lin)(p, d, N, M, n, ego->m, K, ego->flags, ego->fftw_flags);
-// free(n);
+// Y(free)(n);
//}
static init_delegate_t init_direct = {"init_guru ()", init_advanced_pre_psi_, WINDOW_HELP_ESTIMATE_m, (DEFAULT_NFFT_FLAGS ^ PRE_PSI), DEFAULT_FFTW_FLAGS};
diff --git a/tests/nfst.c b/tests/nfst.c
index 44d7bec..99d7dd9 100644
--- a/tests/nfst.c
+++ b/tests/nfst.c
@@ -29,7 +29,7 @@
#include "cycle.h"
#include "nfst.h"
-#define ABSPATH(x) ABS_SRCDIR SEP "tests" SEP x
+#define ABSPATH(x) ABS_SRCDIR "/tests/" x
/* Testcase delegate. */
typedef struct testcase_delegate_s testcase_delegate_t;
@@ -189,7 +189,7 @@ static R trafo_direct_cost(X(plan) *p)
x += 1;
}
X(finalize)(&p2);
- free(N);
+ Y(free)(N);
}
}
}
@@ -386,11 +386,12 @@ static void setup_file(const testcase_delegate_t *ego_, int *d, int **N, int *NN
const testcase_delegate_file_t *ego = (const testcase_delegate_file_t*)ego_;
int j;
char filename[200];
- char* c = rindex(ego->filename, SEP[0]);
+ char* c = strrchr(ego->filename, '/');
FILE *file = fopen(ego->filename, "r");
filename[0] = (char) 0;
- strcpy(filename, &c[1]);
+ strncpy(filename, &c[1], 200);
+ filename[199] = (char) 0;
printf("%-31s", filename);
/* Dimensions. */
@@ -450,10 +451,10 @@ static void setup_file(const testcase_delegate_t *ego_, int *d, int **N, int *NN
static void destroy_file(const testcase_delegate_t *ego_, int *N, R *x, R *f_hat, R *f)
{
UNUSED(ego_);
- free(N);
- free(x);
- free(f_hat);
- free(f);
+ Y(free)(N);
+ Y(free)(x);
+ Y(free)(f_hat);
+ Y(free)(f);
}
static void setup_online(const testcase_delegate_t *ego_, int *d, int **N, int *NN, int *M, R **x, R **f_hat, R **f)
@@ -626,10 +627,10 @@ static void setup_adjoint_online(const testcase_delegate_t *ego_, int *d, int **
static void destroy_online(const testcase_delegate_t *ego_, int *N, R *x, R *f_hat, R *f)
{
UNUSED(ego_);
- free(N);
- free(x);
- free(f_hat);
- free(f);
+ Y(free)(N);
+ Y(free)(x);
+ Y(free)(f_hat);
+ Y(free)(f);
}
/* Initializers. */
@@ -667,7 +668,7 @@ static void init_advanced_pre_psi_(init_delegate_t *ego, X(plan) *p, const int d
for (i = 0; i < d; i++)
n[i] = 2 * (int)(Y(next_power_of_2)(N[i]));
X(init_guru)(p, d, N, M, n, ego->m, ego->flags, ego->fftw_flags);
- free(n);
+ Y(free)(n);
}
static init_delegate_t init_direct = {"init_guru ()", init_advanced_pre_psi_, WINDOW_HELP_ESTIMATE_m, (DEFAULT_NFFT_FLAGS ^ PRE_PSI), DEFAULT_FFTW_FLAGS};
--
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