A fast technique for the full-wave optimization of transmission or reflection properties of general linear time-invariant high-frequency components is proposed. The method is based on the zeros and poles of the rational function representing the scattering parameters of the device being designed and it is the generalization of the technique developed for the design by optimization of microwave filters. The performance of the proposed technique is demonstrated with two examples: a patch antenna and a branchline coupler. Fast convergence was observed for all examples, regardless of the quality of the starting point.