An active-set algorithm for nonlinear programming using linear programming and equality constained subproblems