Gradient-based methods with subspace acceleration for quadratic programming problems and applications