Package gnu.kawa.functions
Class Arrays
java.lang.Object
gnu.kawa.functions.Arrays
Static methods for implementing Scheme (SRFI-25) arrays.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Class for implementing computed (virtual) array.static class
General array "view" class using a Procedure index transformer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GeneralArray
allocateArray
(Array shape) Convenience method for resolving shape specifiers.static <E> Array
<E> getBuiltArray
(Array shape, Procedure getter) static <E> Array
<E> getBuiltArray
(Array shape, Procedure getter, Procedure setter) static <E> Array
<E> getTransformed
(Array<E> base, Procedure transformer, Array shape) static int[]
handleShapeSpecifier
(Array shape, int rank, int[] dimensions, boolean toShape) Process a shape specifier.static Array
makeFromSimple
(int[] dimensions, int[] lowBounds, Object buffer, PrimType elementType) static Array
makeFromValues
(Array shape, Object[] values) static Array
makeSimple
(Array shape, SimpleVector base) static Array
Convert a sequence of (lower,upper) bounds to a SRFI-25 shape.static Array
shareArray
(Array array, Array shape, Procedure proc)
-
Constructor Details
-
Arrays
public Arrays()
-
-
Method Details
-
shape
Convert a sequence of (lower,upper) bounds to a SRFI-25 shape. -
handleShapeSpecifier
Process a shape specifier.- Parameters:
shape
- A canonical shape (rank*2 array) or a shape specifier (vector whose length is the rank).rank
- The rank of arrays of that shape.dimensions
- Ignored if toShape. Otherwise, must have length==rank, and is modified with (hi-lo).toShape
- : True if used by->shape
.- Returns:
- If toShape: a rank*2 shape array as an int[]; otherwise: vector of low-bounds (or null if all zero).
-
allocateArray
Convenience method for resolving shape specifiers. -
makeFromValues
-
makeFromSimple
-
makeSimple
-
getBuiltArray
-
getBuiltArray
-
getTransformed
-