computes the Castelnuovo-Mumford regularity of a given homogeneous ideal