Fitting Generalized Linear Models Subject to Constraints