package octez-libs
type t = Polynomial_unsafe.t
type elt = scalar
val empty : t
val allocate : int -> t
allocate len
creates a C array of size len
initialized with zeros.
init n f
returns a fresh C array of length n
, with element number i
initialized to the result of f i
.
val degree : t -> int
degree p
returns the index of the last non-zero element of p
. Returns -1 if all elements of p
are zero.
val erase : t -> int -> unit
erase p n
fills with zeros the first n
elements of p
.
val length : t -> int
length c
returns the length of a C array c
get_inplace c i res
copies the i
-th element of a C array c
in res
iter_copy_elt f a
applies function f
in turn to a **copy** of all the elements of a
. It is equivalent to f a.(0); f a.(1); ...; f a.(length a - 1); ()
.
Same as iter_copy_elt
, but the function is applied to the index of the element as first argument, and a **copy** of the element itself as second argument.
copy c
copies len
elements from a C array c
starting from position offset
blit src src_off dst dst_off len
copies len
elements from src
to dst
starting at the respective offsets.
equal a offset1 b offset2
returns true if the segments of len
elements of a
and b
are equal starting from their respective offsets offset1
(for a
) and offset2
(for b
).
to_array c
converts a C array c
to an OCaml array
val of_bigstring : Bigstringaf.t -> t
val to_bigstring : t -> Bigstringaf.t
fold_left_map
is a combination of fold_left and map that threads an accumulator through calls to f
.
val primitive_root_of_unity : int -> scalar
val generator : scalar
val build_domain : int -> scalar array
val build_domain_power_of_two : log:int -> scalar array