Beispiel #1
0
 def test_legdiv(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 = leg.legadd(ci, cj)
             quo, rem = leg.legdiv(tgt, ci)
             res = leg.legadd(leg.legmul(quo, ci), rem)
             assert_equal(trim(res), trim(tgt), err_msg=msg)
Beispiel #2
0
 def test_legdiv(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 = leg.legadd(ci, cj)
             quo, rem = leg.legdiv(tgt, ci)
             res = leg.legadd(leg.legmul(quo, ci), rem)
             assert_equal(trim(res), trim(tgt), err_msg=msg)
Beispiel #3
0
 def test_legadd(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 = leg.legadd([0]*i + [1], [0]*j + [1])
             assert_equal(trim(res), trim(tgt), err_msg=msg)
Beispiel #4
0
 def test_legadd(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 = leg.legadd([0]*i + [1], [0]*j + [1])
             assert_equal(trim(res), trim(tgt), err_msg=msg)
Beispiel #5
0
def legadd(c1, c2):
    from numpy.polynomial.legendre import legadd
    return legadd(c1, c2)
Beispiel #6
0
def legadd(c1, c2):
    from numpy.polynomial.legendre import legadd
    return legadd(c1, c2)