Hi,
the second solution is indeed very nice.
I tested with
 A = Matrix(QQ, 2,3, [1,2,3,4,5,6]);A
giving:
[1 2 3]
[4 5 6]
res=[A[rows,cols] for cols in Combinations(A.ncols(),2) for rows in
Combinations(A.nrows(),2)];res


[[1 2]
[4 5], [1 3]
[4 6], [2 3]
[5 6]]

this is more or less my question this output is not really readable though
correct.
for i in range(len(res)):print res[i].det()

-3
-6
-3
A.minors(2)
[-3, -6, -3]

And some different, how do Ishow output easier, is HERE a possibility to
show a picture (screen capture) of sage-sheet?

Greets
   Peter

2010/2/2 Jason Grout <jason-s...@creativetrax.com>

> On 02/01/2010 08:12 AM, javier wrote:
>
>> You can see the source of the "minors" method using
>>
>> sage: M.minors??
>>
>> (you need to have defined M beforehand).
>>
>> By browsing at that source one can easily find the general way of
>> doing it:
>>
>> sage: A = Matrix(QQ, 3, [1,2,3,4,5,6,7,8,9])
>> sage: [A.matrix_from_rows_and_columns(rows, cols) for cols in
>> combinations_iterator(range(A.ncols()), 2) for rows in
>> combinations_iterator(range(A.nrows()),2)]
>> [
>> [1 2]  [1 2]  [4 5]  [1 3]  [1 3]  [4 6]  [2 3]  [2 3]  [5 6]
>> [4 5], [7 8], [7 8], [4 6], [7 9], [7 9], [5 6], [8 9], [8 9]
>> ]
>>
>>
>
> Or slightly easier to read:
>
>
> sage: A = Matrix(QQ, 3, [1,2,3,4,5,6,7,8,9])
> sage: [A[rows,cols] for cols in Combinations(A.ncols(),2) for rows in
> Combinations(A.nrows(),2)]
>
> [
> [1 2]  [1 2]  [4 5]  [1 3]  [1 3]  [4 6]  [2 3]  [2 3]  [5 6]
> [4 5], [7 8], [7 8], [4 6], [7 9], [7 9], [5 6], [8 9], [8 9]
> ]
>
>
>
> Thanks,
>
> Jason
>
> --
> Jason Grout
>
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com<sage-support%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to