Reconstruction of functions from discrete mean values