On Thu, 14 Aug 2014, Vincent Delecroix wrote:
"range(2)" is not suited for cartesian product. If you want to
consider integer mod 2 you can use
cartesian_product([Zmod(2)] * 10)
Uh, cartesian_product and CartesianProduct on same system. My love-hate
-relationship to Sage just moved slightly to hate-side.
On Thu, 14 Aug 2014, Nils Bruin wrote:
If you want to generate a list of arguments that have to be passed as
separate arguments, you can use in python:
CartesianProduct( * [range(2) for i in range(3)] )
Moved few degrees to love-side for this. Thanks!
As Vincent points out, there are also alternative constructions, such as
"cartesian_product", which return more intricately wrapped results. It
depends on your applications if that is useful.
Actually I was asked to check some properties of square matrices. With
matrix(QQ,n,n,B)
, where B is a vector made of bits or values from [1,2,3] or whatever I
can construct all needed matrices. But this got more complicated: Now I
should generate lower triangular matrices with 1's as diagonal. Continuing
to think...
And thanks to you also!
--
Jori Mäntysalo
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.