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
Z2element toshort int - Operators:
+=,*=,/=+,/,*as global functions returning a newZ2object<<outputting theZ2element as an integer tostd::ostream
The Polynomial class implements operations on polynomials with coefficients in
- Constructors: default and from an array of
Z2coefficients - 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 multiplicationmodfor computing the quotient and remainder for polynomial divisionoperator/andoperator%for division and modulusoperator<<andoperator>>for outputting and inputting polynomials in a custom format