Bill Allombert on Tue, 02 Apr 2013 10:47:45 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

slice of matrices


Dear PARI developers,

We are contemplating a minor change in the semantic of matrix slices.
Currently all matrix slices are t_MAT.

? M=[1,2,3;4,5,6]
%1 = [1,2,3;4,5,6]
? M[1,1..2]
%2 = Mat([1,2])
? M[1..2,1]
%3 = [1;4]

However in this two last cases, the user might legitimely expect that
the following holds:

    M[1,1..2] = M[1,][1..2]
    M[1..2,1] = M[,1][1..2]

Thus it should be:

? M[1,1..2]
%3 = [1,2]
? M[1..2,1]
%2 = [1,4]~

(i.e t_VEC/t_COL and not t_MAT).

Of course
M[1..1,1..2] and M[1..2,1..1] would still return a t_MAT.

Opinions ?

Cheers,
Bill.