# NOT RUN {
A <- list( list( list(c(1),c(2) ),c(-1)), list(list(c(3)),c(1)) )
# where -1 is the multiplicative factor of the first array and 1 is the
# multiplicative factor of the second array
B<-list( list(c(5),c(7)))
# where 7 is the multiplicative factor of the first array
mpCart(A,B)
# generates [[[1],[2],[5]], -7] , [[[3],[5]], 7]
A <- list( list( list( c(1,0),c(1,0) ), c(-1)), list( list( c(2,0)), c(1) ))
B <- list( list( list( c(1,0)), c(1)) )
mpCart(A,B)
# generates [[[1,0],[1,0],[1,0]], -1], [[[2,0],[1,0]],1]
# }
Run the code above in your browser using DataLab