Esempio n. 1
0
 def _repr_(self):
     if self._approximation.length() >= 0:
         from printing import repr_matrix
         coeffs = [ [ self[i,j] for j in range(self.ncols()) ] for i in range(self.nrows()) ]
         return repr_matrix(coeffs)
     else:
         return Element_inexact._repr_(self)
Esempio 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)
Esempio n. 3
0
 def __repr__(self):
     from printing import repr_matrix
     return repr_matrix([ [ self[i,j] for j in range(self.ncols()) ] for i in range(self.nrows()) ])