Pari.Polynomial
type 'a t = ('a polynomial, ring) typ constraint 'a = ('b, ring) typ
val to_string : 'a t -> string
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 is_irreducible : 'a t -> bool
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
[|
(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 qmin = Polynomial.minimal q;;
val qmin : ('a, ring) typ 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, ring) typ t ->
((finite_field, field) typ, [ `ROW ]) Vector.t
val fold_left : f:('b -> 'a -> 'a) -> acc:'a -> 'b t -> 'a