Module Pari.Polynomial

type 'a t = 'a polynomial ty constraint 'a = 'b ty
val to_string : 'a t -> string
val mul : 'a t -> 'a t -> 'a t
val div : 'a t -> 'a t -> 'a t
val equal : 'a t -> 'a t -> bool
val add : 'a t -> 'a t -> 'a t
val sub : 'a t -> 'a t -> 'a t
val neg : 'a t -> 'a t
val eval : 'a t -> 'a -> 'a
val degree : 'a t -> int
val create : 'a array -> 'a t

create a returns a_{n-1} X^{n-1} + ... + a_0 for array a of length n.

# let q = Polynomial.create
  [|
    Integer.of_int 1;
    Integer.of_int (-111);
    Integer.of_int 6064;
    Integer.of_int (-189804);
  |];;
val q : Integer.t Polynomial.t = <abstr>
# Polynomial.to_string q;;
- : string = "x^3 - 111*x^2 + 6064*x - 189804"
# let zero = Polynomial.create [| Integer.of_int 0 |];;
val zero : Integer.t Polynomial.t = <abstr>
# let qq = Polynomial.create [| q; q; zero; zero |];;
val qq : Integer.t Polynomial.t Polynomial.t = <abstr>
# Polynomial.to_string qq;;
- : string =
"(x^3 - 111*x^2 + 6064*x - 189804)*y^3 + (x^3 - 111*x^2 + 6064*x - 189804)*y^2"
val of_string : string -> 'a t option
val deriv : ?indeterminate:int -> 'a t -> 'a t
val derivn : ?indeterminate:int -> 'a t -> int -> 'a t
val cyclotomic : Signed.long -> Integer.t t
val is_irreducible : 'a t -> bool
val minimal : 'a t -> 'a t

minimal p reduces p to be the minimal polynomial of the roots of p over the field of the rational numbers.

# let q = Polynomial.create
  [|
    (Rational.of_int 1);
    (Rational.of_int (-111));
    (Rational.of_int 6064);
    (Rational.of_int (-189804));
  |];;
val q : Rational.t Polynomial.t = <abstr>
# Polynomial.to_string q;;
- : string = "x^3 - 111*x^2 + 6064*x - 189804"
# let qmin = Polynomial.minimal q;;
val qmin : Rational.t Polynomial.t = <abstr>
# Polynomial.to_string qmin;;
- : string = "x^3 - x^2 - 60*x - 364"
# Number_field.(are_isomorphic (create q) (create qmin));
- : bool = true
val (.%[]) : 'a t -> int -> 'a
val roots_ff : finite_field ty t -> (finite_field ty, [ `ROW ]) Vector.t
val fold_left : f:('b -> 'a -> 'a) -> acc:'a -> 'b t -> 'a
val fold_left2 : f:('a -> 'b -> 'c -> 'c) -> acc:'c -> 'a t -> 'b t -> 'c
val fold_left2_vec : f:('a -> 'b -> 'c -> 'c) -> acc:'c -> 'a t -> ('b, _) Vector.t -> 'c
val inj_base_ring : inj:('a -> 'b) -> 'a t -> 'b t
val pol1_f2xx : Signed.long -> Signed.long -> 'a ty
val polx_f2xx : Signed.long -> Signed.long -> 'a ty
val pol1_flxx : Signed.long -> Signed.long -> 'a ty
val polx_flxx : Signed.long -> Signed.long -> 'a ty
val polisclass : 'a ty -> Signed.long
val polrootsff : 'a ty -> 'a ty -> 'a ty -> 'a ty
val polteichmuller : 'a ty -> pari_ulong -> Signed.long -> 'a ty
val polhensellift : 'a ty -> 'a ty -> 'a ty -> Signed.long -> 'a ty
val polcyclofactors : 'a ty -> 'a ty
val poliscyclo : 'a ty -> Signed.long
val poliscycloprod : 'a ty -> Signed.long
val polredord : 'a ty -> 'a ty
val polred : 'a ty -> 'a ty
val polred0 : 'a ty -> Signed.long -> 'a ty -> 'a ty
val polred2 : 'a ty -> 'a ty
val polredabs : 'a ty -> 'a ty
val polredabs0 : 'a ty -> Signed.long -> 'a ty
val polredabs2 : 'a ty -> 'a ty
val polredabsall : 'a ty -> Signed.long -> 'a ty
val poltomonic : 'a ty -> 'a ty Ctypes_static.ptr -> 'a ty
val polcompositum0 : 'a ty -> 'a ty -> Signed.long -> 'a ty
val poldiscfactors : 'a ty -> Signed.long -> 'a ty
val polmod_nffix : string -> 'a ty -> 'a ty -> int -> 'a ty
val polmod_nffix2 : string -> 'a ty -> 'a ty -> 'a ty -> int -> 'a ty
val polcyclo_eval : Signed.long -> 'a ty -> 'a ty
val polhermite : Signed.long -> Signed.long -> 'a ty
val polhermite_eval0 : Signed.long -> 'a ty -> Signed.long -> 'a ty
val polhermite_eval : Signed.long -> 'a ty -> 'a ty
val pollaguerre : Signed.long -> 'a ty -> Signed.long -> 'a ty
val pollaguerre_eval : Signed.long -> 'a ty -> 'a ty -> 'a ty
val pollaguerre_eval0 : Signed.long -> 'a ty -> 'a ty -> Signed.long -> 'a ty
val pollegendre : Signed.long -> Signed.long -> 'a ty
val pollegendre_reduced : Signed.long -> Signed.long -> 'a ty
val pollegendre_eval : Signed.long -> 'a ty -> 'a ty
val pollegendre_eval0 : Signed.long -> 'a ty -> Signed.long -> 'a ty
val polint : 'a ty -> 'a ty -> 'a ty -> 'a ty Ctypes_static.ptr -> 'a ty
val polint_i : 'a ty -> 'a ty -> 'a ty -> Signed.long Ctypes_static.ptr -> 'a ty
val polintspec : 'a ty -> 'a ty -> 'a ty -> Signed.long -> Signed.long Ctypes_static.ptr -> 'a ty
val polchebyshev : Signed.long -> Signed.long -> Signed.long -> 'a ty
val polchebyshev_eval : Signed.long -> Signed.long -> 'a ty -> 'a ty
val polchebyshev1 : Signed.long -> Signed.long -> 'a ty
val polchebyshev2 : Signed.long -> Signed.long -> 'a ty
val polrecip : 'a ty -> 'a ty
val polgalois : 'a ty -> Signed.long -> 'a ty
val polcoef : 'a ty -> Signed.long -> Signed.long -> 'a ty
val polcoef_i : 'a ty -> Signed.long -> Signed.long -> 'a ty
val poldegree : 'a ty -> Signed.long -> Signed.long
val pollead : 'a ty -> Signed.long -> 'a ty
val polfnf : 'a ty -> 'a ty -> 'a ty
val poldivrem : 'a ty -> 'a ty -> 'a ty Ctypes_static.ptr -> 'a ty
val polrootspadic : 'a ty -> 'a ty -> Signed.long -> 'a ty
val poldisc0 : 'a ty -> Signed.long -> 'a ty
val polresultant0 : 'a ty -> 'a ty -> Signed.long -> Signed.long -> 'a ty
val polsym : 'a ty -> Signed.long -> 'a ty
val polresultantext0 : 'a ty -> 'a ty -> Signed.long -> 'a ty
val polresultantext : 'a ty -> 'a ty -> 'a ty
val pol0_f2x : Signed.long -> 'a ty
val pol1_f2x : Signed.long -> 'a ty
val polx_f2x : Signed.long -> 'a ty
val polx_zx : Signed.long -> 'a ty
val pol_x_powers : Signed.long -> Signed.long -> 'a ty
val polclass : 'a ty -> Signed.long -> Signed.long -> 'a ty
val polmodular : Signed.long -> Signed.long -> 'a ty -> Signed.long -> Signed.long -> 'a ty
val polmodular_zm : Signed.long -> Signed.long -> 'a ty
val polmodular_zxx : Signed.long -> Signed.long -> Signed.long -> Signed.long -> 'a ty
val polgraeffe : 'a ty -> 'a ty
val polmod_to_embed : 'a ty -> Signed.long -> 'a ty
val polrootsbound : 'a ty -> 'a ty -> 'a ty
val polsubcyclo : Signed.long -> Signed.long -> Signed.long -> 'a ty
val polsubcyclofast : 'a ty -> Signed.long -> Signed.long -> Signed.long -> 'a ty
val polzag : Signed.long -> Signed.long -> 'a ty
val polylog0 : Signed.long -> 'a ty -> Signed.long -> Signed.long -> 'a ty
val polylogmult : 'a ty -> 'a ty -> Signed.long -> 'a ty
val polylogmult_interpolate : 'a ty -> 'a ty -> 'a ty -> Signed.long -> 'a ty
val pol_x : Signed.long -> 'a ty
val pol_xn : Signed.long -> Signed.long -> 'a ty
val pol_xnall : Signed.long -> Signed.long -> 'a ty
val polxn_flx : Signed.long -> Signed.long -> 'a ty
val pol_1 : Signed.long -> 'a ty
val pol_0 : Signed.long -> 'a ty
val pol0_flx : Signed.long -> 'a ty
val pol1_flx : Signed.long -> 'a ty
val polx_flx : Signed.long -> 'a ty