示例#1
0
 def test_compute_breakdata_2(self):
     funs = np.array([self.fun0, self.fun1])
     breaks = compute_breakdata(funs)
     x, y = list(breaks.keys()), list(breaks.values())
     self.assertLessEqual(infnorm(x-np.array([-1,0,1])), eps)
     self.assertLessEqual(infnorm(y-np.array([np.exp(-1),np.exp(0),
                                              np.exp(1)])), 2*eps)
示例#2
0
 def test_compute_breakdata_1(self):
     funs = np.array([self.fun0])
     breaks = compute_breakdata(funs)
     x, y = list(breaks.keys()), list(breaks.values())
     self.assertLessEqual(infnorm(x - np.array([-1, 0])), eps)
     self.assertLessEqual(
         infnorm(y - np.array([np.exp(-1), np.exp(0)])), 2 * eps)
示例#3
0
 def test_compute_breakdata_2(self):
     funs = array([self.fun0, self.fun1])
     breaks = compute_breakdata(funs)
     x, y = list(breaks.keys()), list(breaks.values())
     self.assertLessEqual(infnorm(x - array([-1, 0, 1])), eps)
     self.assertLessEqual(
         infnorm(y - array([exp(-1), exp(0), exp(1)])), 2 * eps)
示例#4
0
 def test_compute_breakdata_empty(self):
     breaks = compute_breakdata(np.array([]))
     # list(...) for Python 2/3 compatibility
     self.assertTrue(np.array(list(breaks.items())).size == 0)
示例#5
0
 def __init__(self, funs):
     self.funs = check_funs(funs)
     self.breakdata = compute_breakdata(self.funs)
     self.transposed = False
示例#6
0
 def test_compute_breakdata_empty(self):
     breaks = compute_breakdata(np.array([]))
     # list(...) for Python 2/3 compatibility
     self.assertTrue(np.array(list(breaks.items())).size==0)
示例#7
0
文件: chebfun.py 项目: chebpy/chebpy
 def __init__(self, funs):
     self.funs = check_funs(funs)
     self.breakdata = compute_breakdata(self.funs)
     self.transposed = False