MATLAB code for performing phase retrieval to determine the complex E field based on a series of intensity measurements. Uses mex functions with optional GPU acceleration.