This program implements two classes to handle algebraic operations over the
The Z2
class represents elements in the field
- Constructors: default and from
short int
- Conversion operator: converts a
Z2
element toshort int
- Operators:
+=
,*=
,/=
+
,/
,*
as global functions returning a newZ2
object<<
outputting theZ2
element as an integer tostd::ostream
The Polynomial
class implements operations on polynomials with coefficients in
- Constructors: default and from an array of
Z2
coefficients - Operators:
+=
,*=
[]
returning the coefficient of the given power
Degree
: returns the polynomial's non-degenerated degreetoString
: outputs the polynomial in text format, ignoring zero terms
Additional global functions include:
operator+
andoperator*
for polynomial addition and multiplicationmod
for computing the quotient and remainder for polynomial divisionoperator/
andoperator%
for division and modulusoperator<<
andoperator>>
for outputting and inputting polynomials in a custom format