Function Approximation with the Sweeping Hinge Algorithm