A generic cache-friendly multi-dimensional array