def test_legpow(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) c = np.arange(i + 1) tgt = reduce(leg.legmul, [c] * j, np.array([1])) res = leg.legpow(c, j) assert_equal(trim(res), trim(tgt), err_msg=msg)
def test_legpow(self): for i in range(5): for j in range(5): msg = "At i=%d, j=%d" % (i, j) c = np.arange(i + 1) tgt = reduce(leg.legmul, [c]*j, np.array([1])) res = leg.legpow(c, j) assert_equal(trim(res), trim(tgt), err_msg=msg)
def legpow(cs, pow, maxpower=16): from numpy.polynomial.legendre import legpow return legpow(cs, pow, maxpower)
def legpow(cs, pow, maxpower=16) : from numpy.polynomial.legendre import legpow return legpow(cs, pow, maxpower)