Can avoid perturbing x0 if it is too close to the bounds? In random initial directions, treat indices 'close to bound' (compared to rhobeg) as at the boundary - a similar logic is already used in initial coordinate directions.
Alternatively, show more information to make perturbation clear:
`
indices=np.arange(0,len(x0))
idx = (xl < x0) & (x0 <= xl + rhobeg)
printValues=False # if find values need adjusting this will be True
if np.any(idx):
printValues=True
warnings.warn(f"x0 too close to lower bound, adjusting {indices[idx]}", RuntimeWarning)
x0[idx] = xl[idx] + rhobeg
Can avoid perturbing x0 if it is too close to the bounds? In random initial directions, treat indices 'close to bound' (compared to rhobeg) as at the boundary - a similar logic is already used in initial coordinate directions.
Alternatively, show more information to make perturbation clear: ` indices=np.arange(0,len(x0)) idx = (xl < x0) & (x0 <= xl + rhobeg) printValues=False # if find values need adjusting this will be True if np.any(idx): printValues=True warnings.warn(f"x0 too close to lower bound, adjusting {indices[idx]}", RuntimeWarning) x0[idx] = xl[idx] + rhobeg
And at the end, raise another RuntimeWarning with the adjusted x0:
warnings.warn(f"Adjusted: x0: {x0}",RuntimeWarning)