Abstract
A computational algorithm is given which calculates exact significance levels of a wide class of permutation tests in the one and two sample problems. This class includes the permutation test based on the means, locally most powerful permutation tests and linear rank tests. When a shift model is assumed confidence intervals can also be obtained. Approximate methods, based on asymptotic expansions, are also presented.