Menu

## GenericGFPoly
in package

GenericGFPoly.php : 27

Represents a polynomial whose coefficients are elements of a GF.

Instances of this class are immutable.

Much credit is due to William Rucklidge since portions of this code are an indirect port of his C++ Reed-Solomon implementation.

##### Tags

author

  Sean Owen

### Table of Contents

$coefficients : array<string|int, mixed>
__construct() : mixed
addOrSubtract() : self
divide() : array<string|int, GenericGFPoly>
evaluateAt() : int
getCoefficient() : int
getCoefficients() : array<string|int, int>
getDegree() : int
isZero() : bool
mod() : self
multiply() : self
multiplyByMonomial() : self
multiplyInt() : self

### Properties

#### $coefficients

GenericGFPoly.php : 29
`private array<string|int, mixed> $coefficients`

### Methods

#### __construct()

GenericGFPoly.php : 39
`public __construct(array<string|int, mixed> $coefficients[, int|null $degree = null ]) : mixed`

##### Parameters

$coefficients : array<string|int, mixed>

  array coefficients as ints representing elements of GF(size), arranged from most significant (highest-power term) coefficient to the least significant

$degree : int|null = null

##### Tags

throws
  QRCodeException

  if argument is null or empty, or if leading coefficient is 0 and this is not a constant polynomial (that is, it is not the monomial "0")

##### Return values

mixed —

#### addOrSubtract()

GenericGFPoly.php : 231
`public addOrSubtract(GenericGFPoly $other) : self`

##### Parameters

$other : GenericGFPoly

##### Return values

self —

#### divide()

GenericGFPoly.php : 143
`public divide(GenericGFPoly $other) : array<string|int, GenericGFPoly>`

##### Parameters

$other : GenericGFPoly

##### Tags

throws
  QRCodeException

##### Return values

array<string|int, GenericGFPoly> —

[quotient, remainder]

#### evaluateAt()

GenericGFPoly.php : 102
`public evaluateAt(int $a) : int`

##### Parameters

$a : int

##### Return values

int —

evaluation of this polynomial at a given point

#### getCoefficient()

GenericGFPoly.php : 74
`public getCoefficient(int $degree) : int`

##### Parameters

$degree : int

##### Return values

int —

$coefficient of x^degree term in this polynomial

#### getCoefficients()

GenericGFPoly.php : 81
`public getCoefficients() : array<string|int, int>`

##### Return values

array<string|int, int> —

#### getDegree()

GenericGFPoly.php : 88
`public getDegree() : int`

##### Return values

int —

$degree of this polynomial

#### isZero()

GenericGFPoly.php : 95
`public isZero() : bool`

##### Return values

bool —

true if this polynomial is the monomial "0"

#### mod()

GenericGFPoly.php : 213
`public mod(GenericGFPoly $other) : self`

##### Parameters

$other : GenericGFPoly

##### Return values

self —

#### multiply()

GenericGFPoly.php : 122
`public multiply(GenericGFPoly $other) : self`

##### Parameters

$other : GenericGFPoly

##### Return values

self —

#### multiplyByMonomial()

GenericGFPoly.php : 191
`public multiplyByMonomial(int $degree, int $coefficient) : self`

##### Parameters

$degree : int
$coefficient : int

##### Tags

throws
  QRCodeException

##### Return values

self —

#### multiplyInt()

GenericGFPoly.php : 169
`public multiplyInt(int $scalar) : self`

##### Parameters

$scalar : int

##### Return values

self —

## Search results