(ap, bq, gen, key)
return nap, bq, operators
Order reduction algorithm used in Hypergeometric and Meijer G
Order reduction algorithm used in Hypergeometric and Meijer G
Order reduction algorithm used in Hypergeometric and Meijer G
def _reduce_order(ap, bq, gen, key):
    """ Order reduction algorithm used in Hypergeometric and Meijer G """
    ap = list(ap)
    bq = list(bq)

    ap.sort(key=key)
    bq.sort(key=key)

    nap = []
    # we will edit bq in place
    operators = []
    for a in ap:
        op = None
        for i in xrange(len(bq)):
            op = gen(a, bq[i])
            if op is not None:
                bq.pop(i)
                break
        if op is None:
            nap.append(a)
        else:
            operators.append(op)

    return nap, bq, operators
def _reduce_order ( ap , bq , gen , key ) : ap = list ( ap ) bq = list ( bq ) ap . sort ( key = key ) bq . sort ( key = key ) nap = [ ] # we will edit bq in place operators = [ ] for a in ap : op = None for i in xrange ( len ( bq ) ) : op = gen ( a , bq [ i ] ) if op is not None : bq . pop ( i ) break if op is None : nap . append ( a ) else : operators . append ( op ) return nap , bq , operators