Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why can 'matrix' not use cached functions?

Consider

def L(n,k):
    if n==k: return 1
    if k<0 or k>n: return 0
    return L(n-1,k-1)+(n+k-1)*L(n-1,k)

print parent(L)
matrix(ZZ, 8, L)

This works. However, as soon as I decorate the above function L with the very reasonable "@CachedFunction" I receive an ValueError: "Invalid matrix constructor".