Esempio n. 1
0
 def __init__(self, f, input=None, output=None, bound='eq'):
     super(TransformedPiecewiseLinearFunctionND, self).__init__()
     assert isinstance(f, PiecewiseLinearFunctionND)
     if bound not in ('lb', 'ub', 'eq'):
         raise ValueError("Invalid bound type %r. Must be "
                          "one of: ['lb','ub','eq']" % (bound))
     self._bound = bound
     self._f = f
     _, ndim = f._tri.points.shape
     if input is None:
         input = [None] * ndim
     self._input = expression_tuple(
         expression(input[i]) for i in range(ndim))
     self._output = expression(output)
Esempio n. 2
0
 def __init__(self,
              f,
              input=None,
              output=None,
              bound='eq',
              validate=True,
              **kwds):
     super(TransformedPiecewiseLinearFunction, self).__init__()
     assert isinstance(f, PiecewiseLinearFunction)
     if bound not in ('lb', 'ub', 'eq'):
         raise ValueError("Invalid bound type %r. Must be "
                          "one of: ['lb','ub','eq']" % (bound))
     self._bound = bound
     self._f = f
     self._inout = expression_tuple([expression(input), expression(output)])
     if validate:
         self.validate(**kwds)
Esempio n. 3
0
 def __init__(self,
              f,
              input=None,
              output=None,
              bound='eq'):
     super(TransformedPiecewiseLinearFunctionND, self).__init__()
     assert isinstance(f, PiecewiseLinearFunctionND)
     if bound not in ('lb', 'ub', 'eq'):
         raise ValueError("Invalid bound type %r. Must be "
                          "one of: ['lb','ub','eq']"
                          % (bound))
     self._bound = bound
     self._f = f
     _,ndim = f._tri.points.shape
     if input is None:
         input = [None]*ndim
     self._input = expression_tuple(
         expression(input[i]) for i in range(ndim))
     self._output = expression(output)