Re: question on collecting t_MAT

Bill Allombert <[email protected]> Fri, 22 May 2026 11:22:44 +0200
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <ahAgZCPHi7yAzpo7@seventeen>
On Fri, May 22, 2026 at 10:33:12AM +0200, [email protected] wrote:
> Doc says that "Matrices are internally represented as a vector of columns".
> But shouldn't below return a 2-element vector of "t_MAT" entries?
> 
> ? [type(A)|e<-[1,2];A<-matrix(2,2,x,y,e)]
> ["t_COL", "t_COL", "t_COL", "t_COL"]

This is correct, this is the same as 
[type(A)|e<-[1,2];A<-[[e,e]~,[e,e]~]]
 
> If not, how to modify to result in ["t_MAT", "t_MAT"] ?

Add brackets:

? [type(A)|e<-[1,2];A<-[matrix(2,2,x,y,e)]]
%2 = ["t_MAT","t_MAT"]

Cheers,
Bill.