Bernard Fischel on Tue, 02 Apr 2013 16:24:45 +0200


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

Re: slice of matrices


What is it faster:
- testing type (t_VEC/t_COL)?
- testing "matsize" components?

Regards
Bernard


2013/4/2 Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
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.