On 7/26/07, mak <[EMAIL PROTECTED]> wrote:
>
> 1.  How do I change the entire row or column of a matrix at once?  In
> pari, I could do e.g. a=[1,2,3;4,5,6], and then put a[1,]=[0,0,0],
> which would give a=[0,0,0;4,5,6].  What's the sage equivalent?


sage: a=[[1,2,3],[4,5,6]]
sage: A = matrix(a)
sage: A

[1 2 3]
[4 5 6]
sage: a[0] = [0,0,0]
sage: A = matrix(a)
sage: A

[0 0 0]
[4 5 6]


>
> 2.  I enter a 100x100 matrix and the notebook doesn't display it; I
> just get something like '100x100 matrix with integer coefficients'.
> I'd like the matrix displayed explicitly (at my own risk).  Clicking
> to the side doesn't have any effect.

I don't know. Maybe something like this would help:


sage: MS = MatrixSpace(IntegerModRing(5),100,100)
sage: A = MS.random_element()
sage: A.matrix_from_rows_and_columns(range(10), range(20,38))

[1 2 4 3 2 1 1 2 4 3 4 1 1 2 4 1 1 3]
[4 1 3 4 1 0 0 1 1 0 0 4 2 0 1 0 0 2]
[1 0 0 1 2 2 1 1 3 0 0 0 2 2 1 1 2 1]
[4 1 3 4 1 2 1 0 1 2 3 3 1 2 2 1 3 3]
[3 4 0 2 1 4 1 1 1 1 0 1 3 4 1 4 1 0]
[1 1 2 0 3 3 0 1 0 4 3 2 3 1 3 4 3 3]
[0 0 1 1 0 0 2 3 2 4 2 4 3 2 1 3 2 2]
[3 2 1 4 1 2 2 3 1 0 1 2 1 0 3 0 1 3]
[1 3 0 2 2 1 3 4 3 0 3 0 2 2 0 0 0 2]
[2 0 0 4 3 4 4 3 1 0 4 3 4 0 3 0 2 0]



>
> Thanks,
> Mak
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to