Convex Analysis For Optimization Algorithms