Pass by reference to inner product functions