Adaptive Constraint Reduction for Convex Quadratic Programming and Training Support Vector Machines