Manipulating Galois Variables
来源:互联网 发布:有组织犯罪知乎 编辑:程序博客网 时间:2024/06/05 17:29
Manipulating Galois Variables
This section describes techniques for manipulating Galois variables or for transferring information between Galois arrays and ordinary MATLAB arrays.
- Note These techniques are particularly relevant if you write M-file functions that process Galois arrays. For an example of this type of usage, enter
edit gf/conv
in the Command Window and examine the first several lines of code in the editor window.Determining Whether a Variable Is a Galois Array
To find out whether a variable is a Galois array rather than an ordinary MATLAB array, use theisa
function. An illustration is below.
mlvar = eye(3);gfvar = gf(mlvar,3);no = isa(mlvar,'gf'); % False because mlvar is not a Galois arrayyes = isa(gfvar,'gf'); % True because gfvar is a Galois array
Extracting Information From a Galois Array
To extract the array elements, field order, or primitive polynomial from a variable that is a Galois array, append a suffix to the name of the variable. The table below lists the exact suffixes, which are independent of the name of the variable.
.x
MATLAB array of type uint16
that contains the data values from the Galois arrayField order.m
Integer of type double
that indicates that the Galois array is in GF(2^m
)Primitive polynomial.prim_poly
Integer of type uint32
that represents the primitive polynomial. The representation is similar to the description inHow Integers Correspond to Galois Field Elements. - Note If the output value is an integer data type and you want to convert it to
double
for later manipulation, use the double
function.The code below illustrates the use of these suffixes. The definition ofempr
uses a vector of binary coefficients of a polynomial to create a Galois array in an extension field. Another part of the example retrieves the primitive polynomial for the field and converts it to a binary vector representation having the appropriate number of bits.
% Check that e solves its own minimal polynomial.e = gf(5,4); % An element of GF(16)emp = minpol(e); % The minimal polynomial, emp, is in GF(2).empr = roots(gf(emp.x,e.m)) % Find roots of emp in GF(16).% Check that the primitive element gf(2,m) is% really a root of the primitive polynomial for the field.primpoly_int = double(e.prim_poly);mval = e.m;primpoly_vect = gf(de2bi(primpoly_int,mval+1,'left-msb'),mval);containstwo = roots(primpoly_vect); % Output vector includes 2.
- Manipulating Galois Variables
- Builtin variables,Positional Parameters,Manipulating Strings,Typing variables,etc.
- Variables
- Variables
- Variables
- variables
- Variables
- Manipulating CSV Files
- 2 Manipulating the Pixels
- Lesson9 Manipulating Data
- CSAPP Lab1--Manipulating Bits
- Manipulating Files With Tcl
- 07 Manipulating Text
- Manipulating Results【翻译】
- CSAPP Lab1:Manipulating Bits
- 伽罗华域(Galois Field,GF,有限域)
- 伽罗华域(Galois Field,GF)乘法运算
- 伽罗华域(Galois Field)上的四则运算
- 认识createjs(二) Container容器及监听事件
- spark 2.0.1(技术预览版)的编译与测试(附一些新特性的介绍)
- height和line-height的区别
- Jenkins+Docker搭建持续集成测试环境
- 第一次机房收费系统-回顾总结(一)
- Manipulating Galois Variables
- 检测内存泄漏malloc模块
- 遍历Map的六种方法
- 下载单张图片到本地相册
- RTMPdump(libRTMP) 源代码分析 9: 接收消息(Message)(接收视音频数据)
- 动画的显示与隐藏
- 全选 vue
- Oracle意外删除数据文件恢复方法
- rsync常见问题