(************************************************** ** polynome.mli *** ** Formal polynome module *** ** POUSSARD PA march 2000 *** **************************************************) open Input_util open Algebra open Format (* it is both a subtype of Euclidian_Ring and Vectorial Space *) module type Polynomial = sig include Vectorial_Space type stathm = int (* type of polynome stathm that is it's degree ! *) type init = (int -> scalar -> unit ) -> unit val one : elem val t_of_int : int -> elem val ( ** ) : elem -> elem -> elem val degree : elem -> stathm val stathm : elem -> stathm val less : stathm -> stathm -> bool val ( // ) : elem -> elem -> elem (* div quotient *) val (mod) : elem -> elem -> elem (* div remainder *) val div_mod : elem -> elem -> elem * elem (* fst : // ,snd : mod *) val derive : elem -> elem (* derivate *) val int : elem -> elem (* intergrate *) val vcreate: init -> int -> elem (* creation function. works like Vector.vcreate *) val monome : scalar -> int ->elem (* elem = t*x^(int) *) val copy : elem -> elem (* copy in new struct *) val vget : elem -> int -> scalar (* raise Invalid_argument if int < 0 *) val vput : elem -> int -> scalar -> unit (* raise Invalid_argument if int < 0 or int > degree *) end (* it is both a subtype of Euclidian_Ring and Banach *) module type Normed_Polynomial = sig include Banach type stathm = int (* type of polynome stathm that is it's degree ! *) type init = (int -> scalar -> unit ) -> unit (*ring struct*) val one : elem val t_of_int : int -> elem val ( ** ) : elem -> elem -> elem val degree : elem -> stathm val stathm : elem -> stathm val less : stathm -> stathm -> bool val ( // ) : elem -> elem -> elem (* div quotient *) val (mod) : elem -> elem -> elem (* div remainder *) val div_mod : elem -> elem -> elem * elem (* fst : // ,snd : mod *) val derive : elem -> elem (* derivate *) val int : elem -> elem (* intergrate *) val vcreate: init -> int -> elem (* creation function. works like Vector.vcreate *) val monome : scalar -> int ->elem (* elem = t*x^(int) *) val copy : elem -> elem (* copy in new struct *) val vget : elem -> int -> scalar (* raise Invalid_argument if int < 0 *) val vput : elem -> int -> scalar -> unit (* raise Invalid_argument if int < 0 or int > degree *) end module Make (R0:Field) : Polynomial with type scalar = R0.elem and type stathm = int module Make_Normed(R0:Normed_Field) : Normed_Polynomial with type scalar = R0.elem and type stathm = int and type norm = R0.norm