2026a
# gfdiv
Galois域上的除法
函数库: TyCommunication
# 语法
quot = gfdiv(b, a)
quot = gfdiv(b, a, p)
quot = gfdiv(b, a, field)
# 说明
gfdiv 函数计算 Galois 域元素的除法。(若要在 Galois 域上除多项式,请改用gfdeconv。)
quot = gfdiv(b, a) 在 GF1 中运算,a 和 b 中的元素只能为 0 或 1。
quot = gfdiv(b, a, p) 将 GF(p) 中的 b 除以 a 并返回商。p 是质数。如果 a 和 b 是大小相同的矩阵,则函数将独立处理每个元素。b、a 和 quot 的所有元素都在 0 和 p-1 之间。 示例
quot = gfdiv(b, a, field) 在 GF(
在所有情况下,尝试除以域的零元素会导致商为 NaN。
# 示例
Galois 域上的除法
using TyCommunication
p = 5
b = Int64.(ones(p-1, 1))
a = 1 : p-1
quot1 = Vector{Any}(undef, length(b))
for i in eachindex(quot1)
quot1[i]=gfdiv(b[i], a[i], p)
end
quot1 = 4-element Vector{Any}:
1
3
2
4