Documentation

GenericGFPoly
in package

FinalYes

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

Properties

$coefficients  : array<string|int, int>

Methods

__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

Methods

__construct()

public __construct(array<string|int, int> $coefficients[, int|null $degree = null ]) : mixed
Parameters
$coefficients : array<string|int, int>

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")

evaluateAt()

public evaluateAt(int $a) : int
Parameters
$a : int
Return values
int

evaluation of this polynomial at a given point

getCoefficient()

public getCoefficient(int $degree) : int
Parameters
$degree : int
Return values
int

$coefficient of x^degree term in this polynomial

getCoefficients()

public getCoefficients() : array<string|int, int>
Return values
array<string|int, int>

getDegree()

public getDegree() : int
Return values
int

$degree of this polynomial

isZero()

public isZero() : bool
Return values
bool

true if this polynomial is the monomial "0"

multiplyByMonomial()

public multiplyByMonomial(int $degree, int $coefficient) : self
Parameters
$degree : int
$coefficient : int
Tags
throws
QRCodeException
Return values
self

multiplyInt()

public multiplyInt(int $scalar) : self
Parameters
$scalar : int
Return values
self

        
On this page

Search results