package polynomial

  1. Overview
  2. Docs
Polynomials over finite fields

Install

Dune Dependency

Authors

Maintainers

Sources

ocaml-polynomial-0.4.0.tar.gz
md5=0ec793314441a5a1106cdf57d1e09304
sha512=1b474604c31c152d0539f912c08fac0c41d61da0ffd27270f37d7121e851ac9cc4f03ca3bb061da266039189a92d4fb50eb0d366ade5814b62cfa03289310515

README.md.html

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.15.0

opam install merlin ocamlformat.0.15.0

Install

opam install polynomial

Coverage

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

Innovation. Community. Security.