Polynomial {boolfun}R Documentation

Multivariate Boolean Polynomial

Description

Implements an element of e, that is, a multivariate polynomial (in x1,...,xn where xi^2=xi holds for all i) with coefficients in GF(2), the field with two elements. Some basic functionality such as addition and multiplication are implemented.

Usage

    x <- Polynomial( initializer )

Arguments

initializer a vector containing 2^n integers in {0,1} or a string holding 2^n characters in {'0','1'}.

Details

Addition and multiplication are computed using C code. For more information, type vignette(polynomial).

Value

The returned value f is an S3 object which is defined using the R.oo package. Methods of the returned value, say weight(), can be accessed in two ways using x$weight() or weight(x).

Public Methods

n() number of variables n
anf() vector of 2^n coefficients
deg() algebraic degree
*.Polynomial(p) returns (this * p) as new Polynomial
+.Polynomial(p) returns (this + p) as new Polynomial
[[.Polynomial(x) evaluate the polynomial on assignment (vector) x
string() algebraic normal form as string
print() displays the result of string()
len() returns 2^n

Author(s)

F.Lafitte

See Also

BooleanFunction, Assignment, R.oo:Object

Examples

    p <- Polynomial( c(0,1,0,1) )
    q <- Polynomial( "01011011" )
    r <- Polynomial( c(anf(p),anf(p),anf(q)) )
    print(p)  
    deg(p)
    p <- p*q + r
    print(p)

[Package boolfun version 0.2.6 Index]