package reedsolomon

  1. Overview
  2. Docs

Module Poly.MakeSource

Basic polynomial representations. Coefficients are members of Ops.OpsBase (which effectively provide '+' and '*')

Parameters

module E : Ops.OpsBase

Signature

Sourcetype elt = E.t

polynomial coefficient type

an array of 'elt's representing the polynomial. powers are at index position (ie lowest first)

Sourcetype t = E.t array

an array of 'elt's representing the polynomial. powers are at index position (ie lowest first)

Sourceval degree : t -> int

the degree of the polynomial

this is represented as |E.zero|

Sourceval zero : t

this is represented as |E.zero|

this is represented as |E.one|

Sourceval one : t

this is represented as |E.one|

this is represented as |E.zero;E.one|

Sourceval x : t

this is represented as |E.zero;E.one|

convert to poly

Sourceval to_poly : elt array -> t

convert to poly

convert from poly

Sourceval of_poly : t -> elt array

convert from poly

make a copy of the poly

Sourceval copy : t -> t

make a copy of the poly

Sourcetype poly_format = {
  1. coef : elt -> string;
  2. indet : int -> string;
}

control over print formatting

Sourceval poly_format : poly_format
Sourceval string_format : bool -> poly_format -> int -> elt -> string
Sourceval to_string : ?down:bool -> ?str:(int -> elt -> string) -> t -> string

create string of poly

Sourceval trim : t -> t

legalise the poly. high order powers which are 0 are removed.

Sourceval slice : t -> int -> t
Sourceval (+:) : t -> t -> t

poly addition

poly subtraction

Sourceval (-:) : t -> t -> t

poly subtraction

poly multiplication

Sourceval (*:) : t -> t -> t

poly multiplication

poly division

Sourceval (/:) : t -> t -> t * t

poly division

scalar multiplication

Sourceval (*:.) : t -> elt -> t

scalar multiplication

scalar division

Sourceval (/:.) : t -> elt -> t

scalar division

multiply poly by x^n

Sourceval (^:) : t -> int -> t

multiply poly by x^n

raise poly to power n

Sourceval (**:) : t -> int -> t

raise poly to power n

Sourceval ext_gcd : t -> t -> t * t

extended gcd algorithm

Sourceval eval : t -> elt -> elt

evaluate polynomial

OCaml

Innovation. Community. Security.