Added a sanity check on the input for QuadraticConstraints.