Fast Solution of Discretized Optimization Problems