On 2015-03-04 09:48, John Cremona wrote:
What is the simplest way to do this.  I have a matrix M (square and
over ZZ, but that is not so important).  I want to make another matric
of the same size & base.  I have not explicitly constructed the
associated matrix space, but I know that I can get it wth M.parent(),
so doing   newM = M.parent()(0) would work, but is there something
more natural?

Do you want to *copy* a matrix or construct a new matrix with the same parent? In the former case, just use copy(). In the latter case, what you did seems right. The fact that you have not *explicitly* constructed the matrix space doesn't matter, it exists anyway.

Of course, in Cython, there are much more efficient ways.

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to