R中是否有任何用于伽罗瓦域(GF)的包?我想用 GF 定义以下矩阵运算。
- 1+1=0
- 1+0=1
- 0+1=1
- 0+0=0
1+1
显然,如果没有指定,R 就无法理解:
> 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