On Mar 19, 2011, at 1:18 AM, SherjilOzair wrote:

> I'll also code in a function which converts a normal Matrix class to a
> Sparse Matrix representation.
> I'll use the List of Non-zero values method, ie a list of
> (coordinates,value) tuple, sorted coordinate-wise with the earlier
> coordinate having more precedence.
> 
> This is as yet, the most elegant representation I feel. Other advanced
> formats like the Yale format, introduce complexity to the code but
> only a slight increase in efficiency, that too for specific cases.
> 
> Of course, for a complete implementation, more than one representation
> needs to be coded in, with sympy choosing which to use according to
> the particular Matrix, but that is a big project in itself, which can
> take a good part of a GSoC summer.
> 
> Thanks,
> Sherjil Ozair

Yes, that is the point of that idea on the ideas page.  The polys module works 
like this.  Internally, there are multiple implementations of the data types 
used by Poly, but externally, Poly() has a nice interface to the user.  It is 
built in layers.  At the bottom, we have multiple implementations for the 
ground types (the constants, if you will).  You can in particular use Python 
ints or gmpy mpz's (the same for rational numbers). This bottom level is just 
Python lists of numbers. At the next level, there are different implementations 
of classes for polynomials.  These classes wrap the lists from the lower level. 
 Right now, the dense version is the main one, but a sparse one is planned.  
And then at the top, you have Poly, which wraps the classes and does smarter 
things for the user, like printing and error checking.

I think Matrix should be the same.  So you can work with what is there now and 
improve it, but eventually the above is what I envision for matrices in SymPy.  
But like you say, it is a whole GSoC summer project to do it (or maybe even 
more).

Aaron Meurer

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to