def __add__(self,other): """ Add """ try: newchebs = [ cheb.__add__(other) for cheb in self.chebfuns ] except NameError: newchebs = [ cheb._new_func(lambda x: cheb._eval(x) + other._eval(x), rtol=min(self.rtol,other.rtol)) for cheb in self.chebfuns ] newguy = self._new_chebfuns(newchebs) return newguy
def _wrap_call(self,func): """ We were called by a wrapped func """ newchebs = [ cheb._new_func(lambda x: func(cheb._eval(x))) for cheb in self.chebfuns ] newguy = self._new_chebfuns(newchebs) return newguy