On 6/14/10 6:19 PM, Florent Hivert wrote:
So basically you still want to write
A = copy(B) # create a semantic copy but no actual copy is done
A[1,2] = 4 # the copy is triggered...
An since the actual entries of the matrix are stored in an attributes called
_entries, two different matrix objects can have share the same entries so that
the matrix object is doing the indirection for you. So this sound good and not
very hard to do...
Hmm. It would be interesting to see if you could have sparse matrices
where it was COW per-entry, rather than per-matrix (i.e., A[1,2]=3 would
just add an entry, an overlay, sort of, on the original data. I can see
some performance issues, but maybe the space savings would be worth it.
Anyways, these are interesting ideas.
Jason
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org