diff --git a/polynome.ml b/polynome.ml index a532e01644fa7b4b104ca7922f067f1e629b4d09..f8fbe3ea60ba7684613250feab0e0c33880f6116 100644 --- a/polynome.ml +++ b/polynome.ml @@ -28,6 +28,7 @@ module type Polynomes = val print: polynome -> string val equal: polynome -> polynome -> bool val add: polynome -> polynome -> polynome + val naive_mul: polynome -> polynome -> polynome end ;; @@ -72,5 +73,17 @@ module Polynome (C : Coefficient) (D : Degree) = then add xx yy else NotNull (m, dx, add xx yy) ) + (*let rec naive_mul x y = match x with + |Null -> Null + |NotNull -> (cx, dx, xx)-> + (match y with + |Null -> Null + |NotNull (cy, dy, yy)-> + match xx with + |Null + |NotNull + ) + *) + end ;; diff --git a/simplepolynome.ml b/simplepolynome.ml new file mode 100644 index 0000000000000000000000000000000000000000..df09c7258d658c69d1c290f7375556c324359678 --- /dev/null +++ b/simplepolynome.ml @@ -0,0 +1,22 @@ +(* projet AP 2016 edouard Paris *) + +open Big_int;; + +module SimpleDegree = + struct + type degree = int + let print d = (string_of_int d) + let add d1 d2 = d1 + d2 + let equal d1 d2 = (d1 == d2) + let is_bigger d1 d2 = (d1 > d2) + end +;; + +module SimpleCoeff = + struct + type coeff = big_int + let print c = (string_of_big_int c) + let add c1 c2 = add_big_int c1 c2 + let equal c1 c2 = eq_big_int c1 c2 + end +;;