  Generalized alternating projections is an algorithm that alternates relaxed
projections onto a finite number of sets to find a point in their intersection.
We consider the special case of two linear subspaces, for which the algorithm
reduces to a matrix teration. For convergent matrix iterations, the asymptotic
rate is linear and decided by the magnitude of the subdominant eigenvalue. In
this paper, we show how to select the three algorithm parameters to optimize
this magnitude, and hence the asymptotic convergence rate. The obtained rate
depends on the Friedrichs angle between the subspaces and is considerably
better than known rates for other methods such as alternating projections and
Douglas-Rachford splitting. We also present an adaptive scheme that, online,
estimates the Friedrichs angle and updates the algorithm parameters based on
this estimate. A numerical example is provided that supports our theoretical
claims and shows very good performance for the adaptive method.
