vectorize qRice() and getGPfromRP()