pl.edu.icm.jlargearrays
Class LargeArrayUtils
- java.lang.Object
-
- pl.edu.icm.jlargearrays.LargeArrayUtils
-
public class LargeArrayUtils extends java.lang.ObjectLargeArray utilities.
-
-
Field Summary
Fields Modifier and Type Field and Description static sun.misc.UnsafeUNSAFEAn object for performing low-level, unsafe operations.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidarraycopy(java.lang.Object src, long srcPos, java.lang.Object dest, long destPos, long length)Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array.static LargeArrayconvert(LargeArray src, LargeArrayType type)Converts LargeArray to a given type.static LargeArraycreate(LargeArrayType type, long length)Creates a new instance of LargeArray.static LargeArraycreate(LargeArrayType type, long length, boolean zeroNativeMemory)Creates a new instance of LargeArraystatic LargeArraycreateConstant(LargeArrayType type, long length, java.lang.Object value)Creates a new constant LargeArray.static LargeArraygenerateRandom(LargeArrayType type, long length)Generates a random LargeArraystatic LargeArrayselect(LargeArray src, LogicLargeArray mask)Returns all elements of the specified source array for which the corresponding mask element is equal to 1.static voidsubarraycopy(java.lang.Object src, int[] srcDim, int[] srcPos, java.lang.Object dest, int[] destDim, int[] destPos, int[] size)Copies a rectangular area of rank 1 to 4 from source to target.static voidsubarraycopy(java.lang.Object src, long[] srcDim, long[] srcPos, java.lang.Object dest, long[] destDim, long[] destPos, long[] size)Copies a rectangular area of rank 1 to 4 from source to target.
-
-
-
Field Detail
-
UNSAFE
public static final sun.misc.Unsafe UNSAFE
An object for performing low-level, unsafe operations.
-
-
Method Detail
-
arraycopy
public static void arraycopy(java.lang.Object src, long srcPos, java.lang.Object dest, long destPos, long length)Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array. Both arrays need to be of the same type. Array bounds are checked.- Parameters:
src- the source array.srcPos- starting position in the source array.dest- the destination array.destPos- starting position in the destination data.length- the number of array elements to be copied.
-
subarraycopy
public static void subarraycopy(java.lang.Object src, long[] srcDim, long[] srcPos, java.lang.Object dest, long[] destDim, long[] destPos, long[] size)Copies a rectangular area of rank 1 to 4 from source to target.- Parameters:
src- source array of the length srcDim[0] * srcDim[1] * ... * srcDim[srcDim.length-1]srcDim- dimensions of the source array (of length 1, 2, 3 or 4)srcPos- lower left corner of the copied area (of length 1, 2, 3 or 4)dest- destination array of the length destDim[0] * destDim[1] * ... * destDim[destDim.length-1]; source and destination arrays must be of the same typedestDim- dimensions of the destination arraydestPos- lower left corner of the destination areasize- dimensions of the copied area
-
subarraycopy
public static final void subarraycopy(java.lang.Object src, int[] srcDim, int[] srcPos, java.lang.Object dest, int[] destDim, int[] destPos, int[] size)Copies a rectangular area of rank 1 to 4 from source to target.- Parameters:
src- source array of the length srcDim[0] * srcDim[1] * ... * srcDim[srcDim.length-1]srcDim- dimensions of the source array (of length 1, 2, 3 or 4)srcPos- lower left corner of the copied area (of length 1, 2, 3 or 4)dest- destination array of the length destDim[0] * destDim[1] * ... * destDim[destDim.length-1]; source and destination arrays must be of the same typedestDim- dimensions of the destination arraydestPos- lower left corner of the destination areasize- dimensions of the copied area
-
createConstant
public static LargeArray createConstant(LargeArrayType type, long length, java.lang.Object value)
Creates a new constant LargeArray.- Parameters:
type- the type of constant LargeArraylength- the length of constant LargeArrayvalue- the value of constant LargeArray- Returns:
- constant LargeArray of a specified type
-
create
public static LargeArray create(LargeArrayType type, long length)
Creates a new instance of LargeArray. The native memory is zeroed.- Parameters:
type- the type of LargeArraylength- number of elements- Returns:
- new instance of LargeArray
-
create
public static LargeArray create(LargeArrayType type, long length, boolean zeroNativeMemory)
Creates a new instance of LargeArray- Parameters:
type- the type of LargeArraylength- number of elementszeroNativeMemory- if true, then the native memory is zeroed- Returns:
- new instance of LargeArray
-
generateRandom
public static LargeArray generateRandom(LargeArrayType type, long length)
Generates a random LargeArray- Parameters:
type- the type of LargeArraylength- number of elements- Returns:
- random LargeArray
-
convert
public static LargeArray convert(LargeArray src, LargeArrayType type)
Converts LargeArray to a given type.- Parameters:
src- the source arraytype- the type of LargeArray- Returns:
- LargeArray of a specified type
-
select
public static LargeArray select(LargeArray src, LogicLargeArray mask)
Returns all elements of the specified source array for which the corresponding mask element is equal to 1.- Parameters:
src- the source arraymask- the mask array- Returns:
- selection of elements from the source array
-
-
DataMelt 3.0 © DataMelt by jWork.ORG