          Astron. Astrophys. 348, 38-42 (1999)

## 4. Performance

Our method has been implemented in C and in IDL . The C version uses the library FFTW ("Fastest Fourier Transform in the West," version ) to perform discrete Fourier transforms (DFT). This library, written by Matteo Frigo and Steven G. Johnson, is considered the quickest DFT library publicly available. The performance of our direct method is compared with that of the over-relaxation method, also implemented in C . The procedure used in the tests is summarized in the following points:

1. A simple model for the dimensionless mass distribution has been chosen. Then the mass distribution is calculated on a grid of points.

2. The associated field is calculated on the same grid using a 3-point Lagrangian interpolation in order to numerically evaluate the derivatives that are needed.

3. Noise is added to the vector field using an analytical model for the noise derived earlier (Lombardi & Bertin 1998b). In practice, the various Fourier components of the noise are added using a suitable model for the power spectrum.

4. The resulting noisy map is inverted using the over-relaxation method and the present direct method. The two dimensionless mass maps obtained are then compared. Moreover, the inversion times are recorded.

The results obtained in the tests are the following:

• The two mass densities obtained are consistent with each other.

• Because of the set of functions used, the errors produced by the direct method are larger on the boundary of the field. For this reason, we suggest that a one pixel strip around the field should be discarded. The area discarded is very small.

• Some tests have been performed by providing to the inversion procedures. This allows us to compare the reconstructed mass density with the original map . From such tests we have noted that the discretization errors of the direct method are slightly smaller than the discretization errors of the over-relaxation method.

• The results of the two methods differ because of the sheet invariance : in particular, the direct method always gives a "reduced" mass map with vanishing total mass.

Regarding the second item, we note that the error is related to the finite sampling scale of the method; the error affects only the outermost pixel because of the proper choice of the truncation (see comment at the end of Sect. 3).

The measured execution times are plotted in Fig. 1 for different values of N. These are the averaged CPU execution times for a single reconstruction on a SUN Ultra 1 workstation. From this figure it is clear that the direct method is much faster than the over-relaxation method. Here we should recall that, because of some characteristics of the FFTW library, the execution time of the direct method can change significantly even for neighbouring values of N. In particular, the inversion is faster when can be factorized with small prime numbers, and is slower in other cases (see Fig. 1). For example, the execution time (on a SUN Ultra 1) changes from 2.942 to 0.232 seconds when N changes from 121 to 122. Finally, we observe that our implementation of the direct method is not optimal: in fact, with a different (non-trivial) use of FFT one might gain an additional factor of 4 on the execution time. Fig. 1. Execution time per call vs. grid number N. The solid line refers to the direct method applied to "good numbers" (values that can be factorized with small primes), the long-dashed refers to the direct method applied to "bad numbers" ( prime), and the short-dashed line to the over-relaxation method.

Besides the appealing aspects of simplicity inherent to the direct method described in this paper, we should note that gaining three orders of magnitude in CPU time will make it possible to undertake a few long-term projects of simulated observations (in particular, with the goal of a statistically sound investigation of the quality of mass reconstruction; but other objectives might be formulated, e.g. in the cosmological context) that would remain practically out of reach for other intrinsically slow reconstruction methods.    © European Southern Observatory (ESO) 1999

Online publication: July 16, 1999 