allow zeros, ones, infs, nans to accept any array, not just matrices