Added optimal control model for denoising and adaptive diffusion.
Fixed a minor bug with the stopping criteria.