Coupled wave theory treating optics of two-dimensional gratings, photonic crystals or cylindrical waveguides is reformulated by using a complex Fourier factorization method, which is a generalization of the classical fast Fourier factorization rules.