package tensorboard

  1. Overview
  2. Docs

Module Pbrt.Repeated_fieldSource

Sourcetype 'a t

optimized data structure for fast inserts so that decoding can be efficient

Type can be constructed at no cost from an existing array.

Sourceval make : 'a -> 'a t

make v create an initial repeated field container v is not used but needed to initialize the internal array data structure.

This design flow is intentional to keep optimal performance.

Therefore lengh (make 1) will return 0.

Sourceval of_array_no_copy : 'a array -> 'a t

of_array_no_copy a initialized a new repeated field container with a.

a is not copied into a but only referenced so any later modification to any a element will affected a t container.

Sourceval length : 'a t -> int

length c returns the number of insterted element in c.

Sourceval add : 'a -> 'a t -> unit

add x c appends a to container c

This operation is not constant time since it might trigger an alocation of an array. However it is optimized for the total insert time of element one by one.

Sourceval to_array : 'a t -> 'a array

to_array c convert the repeated field container to an array.

Sourceval to_list : 'a t -> 'a list

to_list c convert the repeated field container to an list.

Sourceval iter : ('a -> unit) -> 'a t -> unit

iter f c applies f to all element in c

Sourceval iteri : (int -> 'a -> unit) -> 'a t -> unit

iteri f c applies f to all element in c

Sourceval fold_left : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b

fold_left f e0 c accumulates e0 through each elements

Sourceval map_to_array : ('a -> 'b) -> 'a t -> 'b array

map_to_array f c map all c element to an array containing f e_i element.

Sourceval map_to_list : ('a -> 'b) -> 'a t -> 'b list

map_to_list f c map all c element to a list containing f e_i element.

OCaml

Innovation. Community. Security.