Operator Splitting Methods For Convex And Nonconvex Optimization