Asymptotic cones and functions in optimization and variational inequalities