Liking cljdoc? Tell your friends :D

criterium.array.resizable

Resizable array types for algorithms where size isn't known upfront.

Provides mutable-size wrappers around primitive arrays that can be resized down (but not up) from their initial capacity. Use cases include algorithms like Knuth histogram binning where the final array size depends on the data.

Three types are provided:

  • ResizableDoubleArray for double values
  • ResizableLongArray for long values
  • ResizableObjectArray for arbitrary objects

All operations respect the current size (not capacity). Map/filter operations return fixed arrays (DoubleArray, LongArray, ObjectArray).

Resizable array types for algorithms where size isn't known upfront.

Provides mutable-size wrappers around primitive arrays that can be
resized down (but not up) from their initial capacity. Use cases include
algorithms like Knuth histogram binning where the final array size
depends on the data.

Three types are provided:
  - ResizableDoubleArray for double values
  - ResizableLongArray for long values
  - ResizableObjectArray for arbitrary objects

All operations respect the current size (not capacity). Map/filter
operations return fixed arrays (DoubleArray, LongArray, ObjectArray).
raw docstring

capacityclj

(capacity arr)

Returns the maximum capacity of a resizable array.

Returns the maximum capacity of a resizable array.
sourceraw docstring

resizable-double-arrayclj

(resizable-double-array capacity)
(resizable-double-array capacity initial-size)

Creates a ResizableDoubleArray with given capacity. With one argument, creates array with size equal to capacity. With two arguments, creates array with given capacity and initial size. The initial size must be between 0 and capacity (inclusive).

Creates a ResizableDoubleArray with given capacity.
With one argument, creates array with size equal to capacity.
With two arguments, creates array with given capacity and initial size.
The initial size must be between 0 and capacity (inclusive).
sourceraw docstring

resizable-double-array?clj

(resizable-double-array? x)

Returns true if x is a ResizableDoubleArray.

Returns true if x is a ResizableDoubleArray.
sourceraw docstring

resizable-long-arrayclj

(resizable-long-array capacity)
(resizable-long-array capacity initial-size)

Creates a ResizableLongArray with given capacity. With one argument, creates array with size equal to capacity. With two arguments, creates array with given capacity and initial size. The initial size must be between 0 and capacity (inclusive).

Creates a ResizableLongArray with given capacity.
With one argument, creates array with size equal to capacity.
With two arguments, creates array with given capacity and initial size.
The initial size must be between 0 and capacity (inclusive).
sourceraw docstring

resizable-long-array?clj

(resizable-long-array? x)

Returns true if x is a ResizableLongArray.

Returns true if x is a ResizableLongArray.
sourceraw docstring

resizable-object-arrayclj

(resizable-object-array capacity)
(resizable-object-array capacity initial-size)

Creates a ResizableObjectArray with given capacity. With one argument, creates array with size equal to capacity. With two arguments, creates array with given capacity and initial size. The initial size must be between 0 and capacity (inclusive).

Creates a ResizableObjectArray with given capacity.
With one argument, creates array with size equal to capacity.
With two arguments, creates array with given capacity and initial size.
The initial size must be between 0 and capacity (inclusive).
sourceraw docstring

resizable-object-array?clj

(resizable-object-array? x)

Returns true if x is a ResizableObjectArray.

Returns true if x is a ResizableObjectArray.
sourceraw docstring

resize!clj

(resize! arr new-size)

Resizes a resizable array to a new size. The new size must be between 0 and capacity (inclusive). Returns the new size.

Resizes a resizable array to a new size.
The new size must be between 0 and capacity (inclusive).
Returns the new size.
sourceraw docstring

set-fixed-array-constructors!clj

(set-fixed-array-constructors! constructors)

Called by criterium.array to provide constructors for fixed array types.

Called by criterium.array to provide constructors for fixed array types.
sourceraw docstring

to-fixedclj

(to-fixed arr)

Converts a resizable array to a fixed array of the same element type. Creates a new array containing only the active elements (0 to size-1). ResizableDoubleArray -> DoubleArray, ResizableLongArray -> LongArray, ResizableObjectArray -> ObjectArray.

Converts a resizable array to a fixed array of the same element type.
Creates a new array containing only the active elements (0 to size-1).
ResizableDoubleArray -> DoubleArray, ResizableLongArray -> LongArray,
ResizableObjectArray -> ObjectArray.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close