(n, a, x=None, **args)
Generates Gegenbauer polynomial of degree `n` in `x`.
Generates Gegenbauer polynomial of degree `n` in `x`.
Generates Gegenbauer polynomial of degree n in x .
def gegenbauer_poly(n, a, x=None, **args):
    """Generates Gegenbauer polynomial of degree `n` in `x`. """
    if n < 0:
        raise ValueError(
            "can't generate Gegenbauer polynomial of degree %s" % n)

    K, a = construct_domain(a, field=True)
    poly = DMP(dup_gegenbauer(int(n), a, K), K)

    if x is not None:
        poly = Poly.new(poly, x)
    else:
        poly = PurePoly.new(poly, Dummy('x'))

    if not args.get('polys', False):
        return poly.as_expr()
    else:
        return poly
def gegenbauer_poly ( n , a , x = None , * * args ) : if n < 0 : raise ValueError ( "can't generate Gegenbauer polynomial of degree %s" % n ) K , a = construct_domain ( a , field = True ) poly = DMP ( dup_gegenbauer ( int ( n ) , a , K ) , K ) if x is not None : poly = Poly . new ( poly , x ) else : poly = PurePoly . new ( poly , Dummy ( 'x' ) ) if not args . get ( 'polys' , False ) : return poly . as_expr ( ) else : return poly