Exemple #1
0
 def check_args(self, x, xmin, xmax):
     x = numpy.array(x, numpy.float_)  # Make a copy
     xmin = numpy.asarray(xmin, numpy.float_)  # Make a copy
     xmax = numpy.asarray(xmax, numpy.float_)  # Make a copy
     if (x.shape != xmin.shape) or (x.shape != xmax.shape):
         raise InputError(x, xmin, xmax)
     if _outside_limits(x, xmin, xmax):
         raise OutOfBoundErr(x, xmin, xmax)
     return x, xmin, xmax
Exemple #2
0
 def check_args(self, x, xmin, xmax):
     x = numpy.array(x, numpy.float_)  # Make a copy
     xmin = numpy.asarray(xmin, numpy.float_)  # Make a copy
     xmax = numpy.asarray(xmax, numpy.float_)  # Make a copy
     if (x.shape != xmin.shape) or (x.shape != xmax.shape):
         raise InputError(x, xmin, xmax)
     if _outside_limits(x, xmin, xmax):
         raise OutOfBoundErr(x, xmin, xmax)
     return x, xmin, xmax
Exemple #3
0
 def func_bounds_wrapper(x, *args):
     if _outside_limits(x, low, high):
         return numpy.inf
     return func(x, *args)
Exemple #4
0
 def func_bounds_wrapper(x, *args):
     if _outside_limits(x, low, high):
         return numpy.inf
     return func(x, *args)