On the computation of the demagnetization tensor for particles of arbitrary shape