The critical exponent for generalized doubly nonnegative matrices