public class Arrays
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Arrays.BuiltArray<E>
Class for implementing computed (virtual) array.
|
static class |
Arrays.ProcTransformedArray<E>
General array "view" class using a Procedure index transformer.
|
Constructor and Description |
---|
Arrays() |
Modifier and Type | Method and Description |
---|---|
static 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,
java.lang.Object buffer,
PrimType elementType) |
static Array |
makeFromValues(Array shape,
java.lang.Object[] values) |
static Array |
makeSimple(Array shape,
SimpleVector base) |
static Array |
shape(java.lang.Object[] vals)
Convert a sequence of (lower,upper) bounds to a SRFI-25 shape.
|
static Array |
shareArray(Array array,
Array shape,
Procedure proc) |
public static Array shape(java.lang.Object[] vals)
public static int[] handleShapeSpecifier(Array shape, int rank, int[] dimensions, boolean toShape)
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
.public static GeneralArray allocateArray(Array shape)
public static Array makeFromSimple(int[] dimensions, int[] lowBounds, java.lang.Object buffer, PrimType elementType)
public static Array makeSimple(Array shape, SimpleVector base)
public static Array shareArray(Array array, Array shape, Procedure proc) throws java.lang.Throwable
java.lang.Throwable
public static <E> Array<E> getBuiltArray(Array shape, Procedure getter, Procedure setter)