A restricted active space (RAS) wave function is introduced, which encompasses many commonly used restricted CI expansions. A highly vectorized algorithm is developed for full CI and other RAS calculations. The algorithm is based on Slater determinants expressed as products of alphastrings and betastrings and lends itself to a matrix indexing C(Iα,Iβ) of the CI vector. The major features are: (1) The intermediate summation over determinants is replaced by two intermediate summations over strings, the number of which is only the square root of the number of determinants. (2) Intermediate summations over strings outside the RAS CI space is avoided and RAS calculations are therefore almost as efficient as full CI calculations with the same number of determinants. (3) An additional simplification is devised for Ms = 0 states, halving the number of operations. For a case with all single and double replacements out from 415 206 Slater determinants yielding 1 136 838 Slater determinants each CI iteration takes 161 s on an IBM 3090/150(VF).