DummyApply function

Apply a function to subsets defined by a dummy matrix