# gfrepcov

Convert one binary polynomial representation to another

## Syntax

```polystandard = gfrepcov(poly2) ```

## Description

Two logical ways to represent polynomials over GF(2) are listed below.

1. `[A_0 A_1 A_2 ... A_(m-1)]` represents the polynomial

`$\text{A_}0+\text{A_1}x+\text{A_2}{x}^{2}+\cdots +\text{A_(m-1)}{x}^{m-1}$`

Each entry `A_k` is either one or zero.

2. [A_0 A_1 A_2 ... A_(m-1)] represents the polynomial

`${x}^{\text{A_0}}+{x}^{\text{A_1}}+{x}^{\text{A_2}}+\cdots +{x}^{\text{A_(m-1)}}$`

Each entry `A_k` is a nonnegative integer. All entries must be distinct.

Format 1 is the standard form used by the Galois field functions in this toolbox, but there are some cases in which format 2 is more convenient.

`polystandard = gfrepcov(poly2) ` converts from the second format to the first, for polynomials of degree at least 2. `poly2` and `polystandard` are row vectors. The entries of `poly2` are distinct integers, and at least one entry must exceed 1. Each entry of `polystandard` is either 0 or 1.

## Examples

The command below converts the representation format of the polynomial 1 + x2 + x5.

`polystandard = gfrepcov([0 2 5])`
```polystandard = 1 0 1 0 0 1 ```