Learn R Programming

lhs (version 1.2.0)

poly_sum: Addition in polynomial representation

Description

Addition in polynomial representation

Usage

poly_sum(p, n, p1, p2)

Value

the sum of p1 and p2

Arguments

p

modulus

n

length of polynomial 1 and 2

p1

polynomial vector 1

p2

polynomial vector 2

Examples

Run this code
gf <- create_galois_field(4)
a <- poly_sum(gf$p, gf$n, c(1, 0), c(0, 1))
stopifnot(all(a == c(1, 1)))

Run the code above in your browser using DataLab