Exemplo n.º 1
0
 def __init__(self, parent, function, **kwargs):
     if isinstance(function, list):
         from printing import repr_polynomial
         self.repr = lambda: repr_polynomial(function, parent.variable_name())
         kwargs['parenthesis_level'] = 0
     LazyApproximation.__init__(self, parent, function, **kwargs)
     if self._length >= 0:
         self._expected_degree = self._length - 1
     else:
         self._expected_degree = Infinity
Exemplo n.º 2
0
 def __init__(self, parent, function, starting_workprec=None, **kwargs):
     if isinstance(function, list):
         nrows = parent.nrows()
         ncols = parent.ncols()
         if len(function) > nrows*ncols:
             raise ValueError("list too long")
         coeffs = function + ([0] * (nrows*ncols-len(function)))
         coeffs = [ coeffs[i*ncols:(i+1)*ncols] for i in range(nrows) ]
         from printing import repr_matrix
         self.repr = lambda: repr_matrix(coeffs)
     LazyApproximation.__init__(self, parent, function, starting_workprec, **kwargs)
Exemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     LazyApproximation.__init__(self, *args, **kwargs)
     self._length = -1
     if not hasattr(self, 'expected_valuation'):
         self.expected_valuation = 0