support soft constraints, or clipping, to emulate matlab's NonNegative