From 95ebd2d6acfa744c5e93287cc6385f4f1359376e Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Sun, 30 Oct 2022 03:42:11 +1300 Subject: wallgen and wallsolve working, visualwall partially done, license added --- src/poly.mli | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 src/poly.mli (limited to 'src/poly.mli') diff --git a/src/poly.mli b/src/poly.mli new file mode 100644 index 0000000..4837142 --- /dev/null +++ b/src/poly.mli @@ -0,0 +1,82 @@ + + +(* Programmed by Jedidiah Barber *) +(* Licensed under the Sunset License v1.0 *) + + +type t + + + +val zero : t + +val one : t + +val singleton : coeff:Z.t -> expnt:Z.t -> t + +val ( ~$ ) : Z.t * Z.t -> t + + + +(* These two functions produce polynomials of degree zero. *) + +val of_int : int -> t + +val of_zint : Z.t -> t + + + +(* The first values are the coefficients, the second values are the exponents. *) +(* Values given by to_* functions are in descending exponent order. *) + +val to_list : t -> (Z.t * Z.t) list + +val of_list : (Z.t * Z.t) list -> t + +val to_array : t -> (Z.t * Z.t) array + +val of_array : (Z.t * Z.t) array -> t + + + +val degree : t -> Z.t + +val get_coeff : expnt:Z.t -> t -> Z.t + + + +val to_string : t -> string + +val print : t -> unit + +val output : Stdlib.out_channel -> t -> unit + +val pp_print : Stdlib.Format.formatter -> t -> unit + + + +val neg : t -> t + +val add : t -> t -> t + +val sub : t -> t -> t + +val mul : t -> t -> t + +val div_rem : t -> t -> t * t + +val div : t -> t -> t + +val rem : t -> t -> t + + + +val ( + ) : t -> t -> t + +val ( - ) : t -> t -> t + +val ( * ) : t -> t -> t + +val ( / ) : t -> t -> t + + -- cgit