Is there any package for Galois fields (GF) in R? I would like to define the following matrix operations with GF.
- 1+1=0
- 1+0=1
- 0+1=1
- 0+0=0
Obviously R doesn't understand the 1+1
without specifying it:
> k <- matrix(c(0,1,1,0,1,0,0,0,0,1), ncol=10);k
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 0 1 1 0 1 0 0 0 0 1
> p <- matrix(c(0,0,0,1,1,1,0,1,0,1), ncol=10);p
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 0 0 0 1 1 1 0 1 0 1
> c <- k+p;c
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 0 1 1 1 2 1 0 1 0 2