Generalized efficient manipulations of sequences of primitive datatype. Includes specializations for java arrays and nio buffers. There are specializations to allow implementations to provide efficient full typed copy functions when the types can be ascertained. Usually this involves a double-dispatch on both the src and dest arguments:
https://en.wikipedia.org/wiki/Double_dispatch.
Generic operations include:
Generalized efficient manipulations of sequences of primitive datatype. Includes specializations for java arrays and nio buffers. There are specializations to allow implementations to provide efficient full typed copy functions when the types can be ascertained. Usually this involves a double-dispatch on both the src and dest arguments: https://en.wikipedia.org/wiki/Double_dispatch. Generic operations include: 1. datatype of this sequence. 2. Writing to, reading from. 3. Construction. 4. Efficient mutable copy from one sequence to another.
(->array item)
Returns nil of item does not share a backing store with an array.
Returns nil of item does not share a backing store with an array.
(->array-copy item)
Copy the data into an array that can correctly hold the datatype. This array may not have the same datatype as the source item
Copy the data into an array that can correctly hold the datatype. This array may not have the same datatype as the source item
(->buffer-backing-store src-ary)
Convert to nio buffer that stores the data for the object. This may have a different datatype than the object, so for instance the backing store for the uint8 datatype is a nio buffer of type int8.
Convert to nio buffer that stores the data for the object. This may have a different datatype than the object, so for instance the backing store for the uint8 datatype is a nio buffer of type int8.
(->typed-buffer item & {:keys [datatype]})
Conversion of a thing to a typed buffer
Conversion of a thing to a typed buffer
(->vector item)
Conversion to persistent vector
Conversion to persistent vector
(add-container-conversion-fn src-container-type dst-container-type convert-fn)
Add a container->container conversion. Function takes a dst-datatype and the src-container and returns a tuple of [result-container result-offset].
Add a container->container conversion. Function takes a dst-datatype and the src-container and returns a tuple of [result-container result-offset].
(add-copy-operation src-container-type
dst-container-type
src-dtype
dst-dtype
unchecked?
copy-fn)
Add a new copy operation. Note that this is a single point in a 5 dimensional space of operations.
Add a new copy operation. Note that this is a single point in a 5 dimensional space of operations.
(copy! src dst)
(copy! src src-offset dst dst-offset n-elems)
(copy! src src-offset dst dst-offset n-elems options)
(copy-raw->item! raw-data ary-target target-offset)
(copy-raw->item! raw-data ary-target target-offset options)
Copy raw data into an array. Returns a tuple of [ary-target result-offset-after-copy]
Copy raw data into an array. Returns a tuple of [ary-target result-offset-after-copy]
(ecount item)
Type hinted ecount so numeric expressions run faster. Calls clojure.core.matrix/ecount.
Type hinted ecount so numeric expressions run faster. Calls clojure.core.matrix/ecount.
(make-typed-buffer datatype elem-count-or-seq & [options])
Support for unsigned datatypes comes via the typed buffer mechanism
Support for unsigned datatypes comes via the typed buffer mechanism
(shape item)
m/shape with fallback to m/ecount if m/shape is not available.
m/shape with fallback to m/ecount if m/shape is not available.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close