I have a pull request here that introduces a matrix object that represents
a matrix through a function.
I.e.
In [1]: i, j = symbols('i,j')
In [2]: X = FunctionMatrix(3,3, Lambda((i,j), i-j))
In [3]: Matrix(X) # explicitly form the matrix if we want to see everything
Out[3]:
⎡0 -1 -2⎤
⎢ ⎥
⎢1 0 -1⎥
⎢ ⎥
⎣2 1 0 ⎦
In [4]: X[1,2] # evaluate lazily
Out[4]: -1
Originally I made this as an alternative to SparseMatrix. This one is lazy
so you can easily create very large matrices and ask for single elements
cheaply. It works well with the MatrixExpr family.
I'm not sure how I should print it though and am looking for suggestions.
Currently I'm printing the expression in the Lambda inside of brackets
In [5]: X
Out[5]: [i - j]
But this doesn't really get the point across (this could just be a list
after all). Any suggestions?
https://github.com/sympy/sympy/pull/1337
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.