Vectorized least squares.