Module Ba.Buffer
type t
= buffer
The type for bigarray buffers.
val create : scalar_type -> int -> buffer
create st count
is a buffer of scalar typest
withcount
scalars.
val scalar_type : buffer -> scalar_type
buffer_scalar_type b
isb
's buffer scalar type.
val length : buffer -> int
buffer_length b
isb
's buffer scalar length.
val byte_length : buffer -> int
buffer_byte_length b
isb
's buffer byte length.
val of_bigarray : ?data:[ `Unsigned | `Float ] -> ('a, 'b) bigarray -> buffer
of_bigarray ba
is a buffer for the bigarrayba
.data
can be used to add information whenever the bigarray kind is:Bigarray.int16_unsigned
, if`Float
is specified the scalar type will be`Float16
.Bigarray.int32
orBigarray.int64
, if`Unsigned
is specified the scalar type will be, respectively`UInt32
and`UInt64
.
- raises Invalid_argument
if the bigarray kind does not correspond to a
Ba.scalar_type
or ifdata
is irrelevant.
val pp : Stdlib.Format.formatter -> buffer -> unit
pp b
prints a textual representation ofb
onppf
. Does not print the buffer's data.