axiom-math
[Top][All Lists]
Advanced

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

Re: [Axiom-math] list of pair


From: William Sit
Subject: Re: [Axiom-math] list of pair
Date: Thu, 16 Mar 2006 16:06:15 -0500



Francois Maltey wrote:

> I try to create a cartesian product :
> 
>  [[10,1],[10,2],[10,3],[10,4],[10,5],[10,6],
>   [20,1],[20,2],[20,3],[20,4],[20,5],[20,6],
>   [30,1],[30,2],[30,3],[30,4],[30,5],[30,6]]
> 
> but I can't !

(1) -> concat [[makeprod(10*i,j)$Product(PI,PI) for i in 1..3] for j in 1..4]

   (1)
   [(10,1), (20,1), (30,1), (10,2), (20,2), (30,2), (10,3), (20,3), (30,3),
    (10,4), (20,4), (30,4)]
                          Type: List Product(PositiveInteger,PositiveInteger)

Is this what you want? Note that Product uses tuple (a,b) whereas [a,b] is a
List.

William




reply via email to

[Prev in Thread] Current Thread [Next in Thread]