To add the Numerical Recipes routines, you must make a few small modifications to the code and to the Makefile, as described below.
four1
and fourn
from Numerical Recipes in
C.
four1.c
and fourn.c
to the
c_source
directory.
four1
and fourn
to nrc_four1
and nrc_fourn
, respectively.
#include <fftw.h>
" at the top of the
source code files.
float
" with
"FFTW_REAL
".
unsigned long
"
with "int
".
6.28318530717959
more decimal places to ensure that full
double-precision accuracy can be used on your machine
(e.g. 6.283185307179586476925286766559
).
Makefile
so
that the NR code will be used. (Or do the equivalent on systems
without make
.) This requires two changes:
# NRC_OBJ = c_source/four1.o c_source/fourn.o(i.e. remove the pound sign, "#").
-DUSE_NRC
to BENCH_CFLAGS
. This
defines the preprocessor symbol USE_NRC
, letting the
program know that it should benchmark the Numerical Recipes in
C subroutines.
four1
and fourn
from Numerical Recipes in
Fortran. (Note that it is perfectly fine to include both the C and
Fortran Numerical Recipes code in the benchmark.)
Of course, you must also have a Fortran compiler, and set up the benchmark to use it (see the installation instructions).
four1.f
and fourn.f
to the
f_source
directory.
four1
and fourn
to nrffour1
and nrffourn
, respectively.
REAL
" with "DOUBLE PRECISION
".
sin
" with "dsin
" and
delete all occurrences of "sngl
".
6.28318530717959d0
more decimal places to ensure that full
double-precision accuracy can be used on your machine
(e.g. 6.283185307179586476925d0
).
Makefile
so
that the NR code will be used. (Or do the equivalent on systems
without make
.) This requires two changes:
# NRF_OBJ = f_source/four1.o f_source/fourn.o(i.e. remove the pound sign, "#").
-DUSE_NRF
to BENCH_CFLAGS
. This
defines the preprocessor symbol USE_NRF
, letting the
program know that it should benchmark the Numerical Recipes in
Fortran subroutines.