In order to apply direct methods routinely to macromolecular crystals it will be necessary to generate a non-atomic theory which is applicable to continuous densities. Reformulation of the 'phase problem' in terms of deconvoluting an autocorrelation function or Patterson synthesis reduces the problem from a theoretically intractable transcendental problem to a system of simultaneous quadratic equations. These quadratic equations may, in principle, always be solved by conjugate direction search techniques. The phase problem is shown to be a class P problem, admitting a deterministic solution in polynomial time. Two algorithms are presented with running times proportional to N2points and Npoints log Npoints per step. These algorithms are a pixel-by-pixel search and a conjugate gradients search. When the data are exact and complete the Fourier magnitudes are readily inverted by them to find the image. An example with real data, from a 15mer of DNA, is also shown.