login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

This domain implements cartesian product, we give example usage here:

fricas
(1) -> X:=Product(IntegerMod 3,Set PF 3)

\label{eq1}\hbox{\axiomType{Product}\ } \left({{\hbox{\axiomType{IntegerMod}\ } \left({3}\right)}, \:{\hbox{\axiomType{Set}\ } \left({\hbox{\axiomType{PrimeField}\ } \left({3}\right)}\right)}}\right)(1)
Type: Type
fricas
size()$X

\label{eq2}24(2)
Type: NonNegativeInteger?
fricas
[index(i)$X for i in 1..size()$X::PositiveInteger]
fricas
Compiling function G3 with type NonNegativeInteger -> Boolean

\label{eq3}\begin{array}{@{}l}
\displaystyle
\left[{\left[ 1, \:{\left\{ \right\}}\right]}, \:{\left[ 1, \:{\left\{ 1 \right\}}\right]}, \:{\left[ 1, \:{\left\{ 2 \right\}}\right]}, \:{\left[ 1, \:{\left\{ 1, \: 2 \right\}}\right]}, \:{\left[ 1, \:{\left\{ 0 \right\}}\right]}, \:{\left[ 1, \:{\left\{ 1, \: 0 \right\}}\right]}, \: \right.
\
\
\displaystyle
\left.{\left[ 1, \:{\left\{ 2, \: 0 \right\}}\right]}, \:{\left[ 1, \:{\left\{ 1, \: 2, \: 0 \right\}}\right]}, \:{\left[ 2, \:{\left\{ \right\}}\right]}, \:{\left[ 2, \:{\left\{ 1 \right\}}\right]}, \:{\left[ 2, \:{\left\{ 2 \right\}}\right]}, \:{\left[ 2, \:{\left\{ 1, \: 2 \right\}}\right]}, \right.
\
\
\displaystyle
\left.\:{\left[ 2, \:{\left\{ 0 \right\}}\right]}, \:{\left[ 2, \:{\left\{ 1, \: 0 \right\}}\right]}, \:{\left[ 2, \:{\left\{ 2, \: 0 \right\}}\right]}, \:{\left[ 2, \:{\left\{ 1, \: 2, \: 0 \right\}}\right]}, \:{\left[ 0, \:{\left\{ \right\}}\right]}, \: \right.
\
\
\displaystyle
\left.{\left[ 0, \:{\left\{ 1 \right\}}\right]}, \:{\left[ 0, \:{\left\{ 2 \right\}}\right]}, \:{\left[ 0, \:{\left\{ 1, \: 2 \right\}}\right]}, \:{\left[ 0, \:{\left\{ 0 \right\}}\right]}, \:{\left[ 0, \:{\left\{ 1, \: 0 \right\}}\right]}, \:{\left[ 0, \:{\left\{ 2, \: 0 \right\}}\right]}, \: \right.
\
\
\displaystyle
\left.{\left[ 0, \:{\left\{ 1, \: 2, \: 0 \right\}}\right]}\right] (3)
Type: List(Product(IntegerMod?(3),Set(PrimeField?(3))))
fricas
reduce(_and,[(lookup(index(i)$X)=i)::Boolean for i in 1..size()$X::PositiveInteger])

\label{eq4} \mbox{\rm true} (4)
Type: Boolean
fricas
lookup(construct(2,[2])$X)

\label{eq5}11(5)
Type: PositiveInteger?
fricas
[random()$X for i in 1..5]

\label{eq6}\left[{\left[ 0, \:{\left\{ 2, \: 0 \right\}}\right]}, \:{\left[ 2, \:{\left\{ 1 \right\}}\right]}, \:{\left[ 0, \:{\left\{ 1, \: 2, \: 0 \right\}}\right]}, \:{\left[ 1, \:{\left\{ 1 \right\}}\right]}, \:{\left[ 2, \:{\left\{ 1, \: 2 \right\}}\right]}\right](6)
Type: List(Product(IntegerMod?(3),Set(PrimeField?(3))))




  Subject:   Be Bold !!
  ( 15 subscribers )  
Please rate this page: