Generalized Convexity and Optimization: Theory and