Characterizing the generalized convexity of a quadratic fractional function