BinaryPolynomial class

An immutable polynomial with coefficients in GF(2).

Bit i of coefficients is the coefficient of x^i. For example, x^3 + x + 1 is represented by 0b1011.

Available extensions
Annotations

Constructors

BinaryPolynomial(BigInt coefficients)
Creates a binary polynomial from packed coefficients.
BinaryPolynomial.fromBinary(String digits)
Creates a binary polynomial from a binary digits string.
factory
BinaryPolynomial.fromExponents(Iterable<int> exponents)
Creates a binary polynomial with coefficients at exponents set.
factory
BinaryPolynomial.fromHex(String digits)
Creates a binary polynomial from hexadecimal digits.
factory
BinaryPolynomial.fromLogicValue(LogicValue value)
Creates a binary polynomial from a two-state value.
factory
BinaryPolynomial.fromRadixString(String literal)
Creates a binary polynomial from a ROHD width/radix-encoded literal.
factory

Properties

coefficients → BigInt
The packed coefficients, with the constant coefficient in bit zero.
final
degree → int
The degree, or -1 for the zero polynomial.
no setter
hashCode → int
The hash code for this object.
no setteroverride
isIrreducible → bool
Whether this polynomial is irreducible over GF(2).
no setter
isZero → bool
Whether this is the zero polynomial.
no setter
packedWidth → int

Available on BinaryPolynomial, provided by the BinaryPolynomialHardwareConversion extension

The minimum packed width, using one bit for the zero polynomial.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

coefficient(int exponent) → bool
Returns the coefficient of x^[exponent].
derivative() → BinaryPolynomial
Returns the formal derivative over GF(2).
divide(BinaryPolynomial divisor) → ({BinaryPolynomial quotient, BinaryPolynomial remainder})
Divides this polynomial by divisor, returning quotient and remainder.
evaluate({required bool x}) → bool
Evaluates this polynomial for x in GF(2).
gcd(BinaryPolynomial other) → BinaryPolynomial
Returns the greatest common divisor of this polynomial and other.
modPow(BigInt exponent, BinaryPolynomial modulus) → BinaryPolynomial
Raises this polynomial to exponent modulo modulus.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toConst({int? width}) → Const

Available on BinaryPolynomial, provided by the BinaryPolynomialHardwareConversion extension

Returns the packed coefficients as a binary-preferred Const.
toLogicValue({int? width}) → LogicValue

Available on BinaryPolynomial, provided by the BinaryPolynomialHardwareConversion extension

Returns the packed coefficients as a two-state LogicValue.
toString() → String
A string representation of this object.
override

Operators

operator %(BinaryPolynomial divisor) → BinaryPolynomial
Returns the remainder after division by divisor.
operator *(BinaryPolynomial other) → BinaryPolynomial
Multiplies two polynomials over GF(2).
operator +(BinaryPolynomial other) → BinaryPolynomial
Adds two polynomials over GF(2).
operator -(BinaryPolynomial other) → BinaryPolynomial
Subtracts two polynomials over GF(2), which is identical to addition.
operator ==(Object other) → bool
The equality operator.
override
operator ~/(BinaryPolynomial divisor) → BinaryPolynomial
Returns the quotient of division by divisor.

Static Properties

one → BinaryPolynomial
The multiplicative identity polynomial.
final
zero → BinaryPolynomial
The zero polynomial.
final