Dipolar interactions in two- and three-dimensional magnetic nanoparticle arrays