* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 1991-2003 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
fftw_flags = (flags & GMX_FFT_FLAG_CONSERVATIVE) ? FFTW_ESTIMATE : FFTW_MEASURE;
- if (pfft == NULL)
+ if (pfft == nullptr)
{
gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
return EINVAL;
}
- *pfft = NULL;
+ *pfft = nullptr;
FFTW_LOCK;
- if ( (fft = (gmx_fft_t)FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == NULL)
+ if ( (fft = (gmx_fft_t)FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == nullptr)
{
FFTW_UNLOCK;
return ENOMEM;
/* allocate aligned, and extra memory to make it unaligned */
p1 = (FFTWPREFIX(complex) *) FFTWPREFIX(malloc)(sizeof(FFTWPREFIX(complex))*(nx+2)*howmany);
- if (p1 == NULL)
+ if (p1 == nullptr)
{
FFTWPREFIX(free)(fft);
FFTW_UNLOCK;
}
p2 = (FFTWPREFIX(complex) *) FFTWPREFIX(malloc)(sizeof(FFTWPREFIX(complex))*(nx+2)*howmany);
- if (p2 == NULL)
+ if (p2 == nullptr)
{
FFTWPREFIX(free)(p1);
FFTWPREFIX(free)(fft);
{
for (k = 0; k < 2; k++)
{
- if (fft->plan[i][j][k] == NULL)
+ if (fft->plan[i][j][k] == nullptr)
{
gmx_fatal(FARGS, "Error initializing FFTW3 plan.");
FFTW_UNLOCK;
fftw_flags = (flags & GMX_FFT_FLAG_CONSERVATIVE) ? FFTW_ESTIMATE : FFTW_MEASURE;
- if (pfft == NULL)
+ if (pfft == nullptr)
{
gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
return EINVAL;
}
- *pfft = NULL;
+ *pfft = nullptr;
FFTW_LOCK;
- if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == NULL)
+ if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == nullptr)
{
FFTW_UNLOCK;
return ENOMEM;
/* allocate aligned, and extra memory to make it unaligned */
p1 = (real *) FFTWPREFIX(malloc)(sizeof(real)*(nx/2+1)*2*howmany + 8);
- if (p1 == NULL)
+ if (p1 == nullptr)
{
FFTWPREFIX(free)(fft);
FFTW_UNLOCK;
}
p2 = (real *) FFTWPREFIX(malloc)(sizeof(real)*(nx/2+1)*2*howmany + 8);
- if (p2 == NULL)
+ if (p2 == nullptr)
{
FFTWPREFIX(free)(p1);
FFTWPREFIX(free)(fft);
fftw_complex *out, const int *onembed,
int ostride, int odist,
unsigned flag */
- fft->plan[0][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up2, 0, 1, (nx/2+1), fftw_flags);
- fft->plan[0][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up1, 0, 1, (nx/2+1), fftw_flags);
- fft->plan[1][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p2, 0, 1, (nx/2+1), fftw_flags);
- fft->plan[1][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p1, 0, 1, (nx/2+1), fftw_flags);
+ fft->plan[0][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up2, nullptr, 1, (nx/2+1), fftw_flags);
+ fft->plan[0][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up1, nullptr, 1, (nx/2+1), fftw_flags);
+ fft->plan[1][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p2, nullptr, 1, (nx/2+1), fftw_flags);
+ fft->plan[1][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p1, nullptr, 1, (nx/2+1), fftw_flags);
- fft->plan[0][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, 0, 1, (nx/2+1), up2, 0, 1, (nx/2+1) *2, fftw_flags);
- fft->plan[0][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, 0, 1, (nx/2+1), up1, 0, 1, (nx/2+1) *2, fftw_flags);
- fft->plan[1][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, 0, 1, (nx/2+1), p2, 0, 1, (nx/2+1) *2, fftw_flags);
- fft->plan[1][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, 0, 1, (nx/2+1), p1, 0, 1, (nx/2+1) *2, fftw_flags);
+ fft->plan[0][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, nullptr, 1, (nx/2+1), up2, nullptr, 1, (nx/2+1) *2, fftw_flags);
+ fft->plan[0][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, nullptr, 1, (nx/2+1), up1, nullptr, 1, (nx/2+1) *2, fftw_flags);
+ fft->plan[1][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, nullptr, 1, (nx/2+1), p2, nullptr, 1, (nx/2+1) *2, fftw_flags);
+ fft->plan[1][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, nullptr, 1, (nx/2+1), p1, nullptr, 1, (nx/2+1) *2, fftw_flags);
for (i = 0; i < 2; i++)
{
{
for (k = 0; k < 2; k++)
{
- if (fft->plan[i][j][k] == NULL)
+ if (fft->plan[i][j][k] == nullptr)
{
gmx_fatal(FARGS, "Error initializing FFTW3 plan.");
FFTW_UNLOCK;
fftw_flags = (flags & GMX_FFT_FLAG_CONSERVATIVE) ? FFTW_ESTIMATE : FFTW_MEASURE;
- if (pfft == NULL)
+ if (pfft == nullptr)
{
gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
return EINVAL;
}
- *pfft = NULL;
+ *pfft = nullptr;
FFTW_LOCK;
- if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == NULL)
+ if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == nullptr)
{
FFTW_UNLOCK;
return ENOMEM;
/* allocate aligned, and extra memory to make it unaligned */
p1 = (real *) FFTWPREFIX(malloc)(sizeof(real) *( nx*(ny/2+1)*2 + 2) );
- if (p1 == NULL)
+ if (p1 == nullptr)
{
FFTWPREFIX(free)(fft);
FFTW_UNLOCK;
}
p2 = (real *) FFTWPREFIX(malloc)(sizeof(real) *( nx*(ny/2+1)*2 + 2) );
- if (p2 == NULL)
+ if (p2 == nullptr)
{
FFTWPREFIX(free)(p1);
FFTWPREFIX(free)(fft);
{
for (k = 0; k < 2; k++)
{
- if (fft->plan[i][j][k] == NULL)
+ if (fft->plan[i][j][k] == nullptr)
{
gmx_fatal(FARGS, "Error initializing FFTW3 plan.");
FFTW_UNLOCK;
{
int i, j, k;
- if (fft != NULL)
+ if (fft != nullptr)
{
for (i = 0; i < 2; i++)
{
{
for (k = 0; k < 2; k++)
{
- if (fft->plan[i][j][k] != NULL)
+ if (fft->plan[i][j][k] != nullptr)
{
FFTW_LOCK;
FFTWPREFIX(destroy_plan)(fft->plan[i][j][k]);
FFTW_UNLOCK;
- fft->plan[i][j][k] = NULL;
+ fft->plan[i][j][k] = nullptr;
}
}
}