package polynomial

  1. Overview
  2. Docs
Polynomials over finite fields

Install

Dune Dependency

Authors

Maintainers

Sources

ocaml-polynomial-0.3.0.tar.gz
md5=7b8c5a85037732fb6e198d4ceb14687b
sha512=3d2ddaf35b085f3e95e47811ec36d12c86c5b6989d1794fc3e28cc3096ec42b2af606ec1c8244b578d6a8437419eac1ff2564d3791be7e9eea870fbf9ad13ec9

Description

Polynomials over finite fields

Published: 01 Dec 2020

README

ocaml-polynomial

Play with polynomial

Examples

Let's have an example with fields

opam switch create . 4.09.1
opam install . -y --with-test --deps-only
opam install . -y
opam install utop
dune utop
#require "ff";
module F379 = Ff.MakeFp(struct let prime_order = Z.of_int 379 end);;
module Poly379 = Polynomial.Make(F379);;
let points =
  [ (F379.of_string "2", F379.of_string "3");
    (F379.of_string "0", F379.of_string "1") ]
in
let interpolated_polynomial = Poly.lagrange_interpolation points in
assert (
  Poly.equal
    (Poly.of_coefficients
       [ (F379.of_string "1", 1);
         (F379.of_string "1", 0) ])
    interpolated_polynomial )

JavaScript compatibility

This library can be transpiled in JavaScript using js_of_ocaml. An example is provided in js/test_js.ml, with the corresponding dune file.

How to help

Install merlin and ocamlformat.0.10

opam install merlin ocamlformat.0.10

Coverage

opam install bisect_ppx -y
dune runtest --instrument-with bisect_ppx --force
bisect-ppx-report html

Dependencies (3)

  1. ff-sig >= "0.5.0" & < "0.6.0"
  2. zarith >= "1.9.1" & < "2.0.0"
  3. dune >= "2.7"

Dev Dependencies (3)

  1. bisect_ppx with-test & >= "2.5.0"
  2. ff with-test & >= "0.5.0" & < "0.6.0"
  3. alcotest with-test

Used by

None

Conflicts

None