added affine constraint check