Example #1
0
 def test_chebdiv(self) :
     for i in range(5) :
         for j in range(5) :
             msg = "At i=%d, j=%d" % (i,j)
             ci = [0]*i + [1]
             cj = [0]*j + [1]
             tgt = cheb.chebadd(ci, cj)
             quo, rem = cheb.chebdiv(tgt, ci)
             res = cheb.chebadd(cheb.chebmul(quo, ci), rem)
             assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #2
0
 def test_chebdiv(self):
     for i in range(5):
         for j in range(5):
             msg = "At i=%d, j=%d" % (i, j)
             ci = [0]*i + [1]
             cj = [0]*j + [1]
             tgt = cheb.chebadd(ci, cj)
             quo, rem = cheb.chebdiv(tgt, ci)
             res = cheb.chebadd(cheb.chebmul(quo, ci), rem)
             assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #3
0
 def test_chebadd(self) :
     for i in range(5) :
         for j in range(5) :
             msg = "At i=%d, j=%d" % (i,j)
             tgt = np.zeros(max(i,j) + 1)
             tgt[i] += 1
             tgt[j] += 1
             res = cheb.chebadd([0]*i + [1], [0]*j + [1])
             assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #4
0
 def test_chebadd(self):
     for i in range(5):
         for j in range(5):
             msg = "At i=%d, j=%d" % (i, j)
             tgt = np.zeros(max(i, j) + 1)
             tgt[i] += 1
             tgt[j] += 1
             res = cheb.chebadd([0]*i + [1], [0]*j + [1])
             assert_equal(trim(res), trim(tgt), err_msg=msg)
Example #5
0
def chebadd(c1, c2):
    from numpy.polynomial.chebyshev import chebadd
    return chebadd(c1, c2)
Example #6
0
def chebadd(c1, c2):
    from numpy.polynomial.chebyshev import chebadd
    return chebadd(c1, c2)
Example #7
0
def Add(self, lhs, rhs):
    lhs = self.chebTransform(lhs);
    rhs = self.chebTransform(rhs)
    return np_cheb.chebadd(lhs, rhs)