Primal and dual active-set methods for convex quadratic programming