def _bounds_dist(self, p):
prob = self.problem<EOL>lb_dist = (p - prob.variable_bounds[<NUM_LIT:0>, ]).min()<EOL>ub_dist = (prob.variable_bounds[<NUM_LIT:1>, ] - p).min()<EOL>if prob.bounds.shape[<NUM_LIT:0>] > <NUM_LIT:0>:<EOL><INDENT>const = prob.inequalities.dot(p)<EOL>const_lb_dist = (const - prob.bounds[<NUM_LIT:0>, ]).min()<EOL>const_ub_dist = (prob.bounds[<NUM_LIT:1>, ] - const).min()<EOL>lb_dist = min(lb_dist, const_lb_dist)<EOL>ub_dist = min(ub_dist, const_ub_dist)<EOL><DEDENT>return np.array([lb_dist, ub_dist])<EOL>
Get the lower and upper bound distances. Negative is bad.