summaryrefslogtreecommitdiff
path: root/src/poly.mli
diff options
context:
space:
mode:
Diffstat (limited to 'src/poly.mli')
-rw-r--r--src/poly.mli82
1 files changed, 82 insertions, 0 deletions
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
+
+