public abstract class IntIndexer extends Indexer
int
primitive type.Modifier and Type | Field and Description |
---|---|
static int |
VALUE_BYTES
The number of bytes used to represent an int.
|
indexable, ONE_STRIDE, sizes, strides
Modifier | Constructor and Description |
---|---|
protected |
IntIndexer(long[] sizes,
long[] strides) |
Modifier and Type | Method and Description |
---|---|
static IntIndexer |
create(int[] array)
Returns
new IntArrayIndexer(array) |
static IntIndexer |
create(int[] array,
long... sizes)
Returns
new IntArrayIndexer(array, sizes) |
static IntIndexer |
create(int[] array,
long[] sizes,
long[] strides)
Returns
new IntArrayIndexer(array, sizes, strides) |
static IntIndexer |
create(IntBuffer buffer)
Returns
new IntBufferIndexer(buffer) |
static IntIndexer |
create(IntBuffer buffer,
long... sizes)
Returns
new IntBufferIndexer(buffer, sizes) |
static IntIndexer |
create(IntBuffer buffer,
long[] sizes,
long[] strides)
Returns
new IntBufferIndexer(buffer, sizes, strides) |
static IntIndexer |
create(IntPointer pointer)
Returns
create(pointer, { pointer.limit() - pointer.position() }, { 1 }, true) |
static IntIndexer |
create(IntPointer pointer,
long... sizes)
Returns
create(pointer, sizes, strides(sizes)) |
static IntIndexer |
create(IntPointer pointer,
long[] sizes,
long[] strides)
Returns
create(pointer, sizes, strides, true) |
static IntIndexer |
create(IntPointer pointer,
long[] sizes,
long[] strides,
boolean direct)
Creates a int indexer to access efficiently the data of a pointer.
|
abstract int |
get(long... indices)
Returns
array/buffer[index(indices)] |
abstract int |
get(long i)
Returns
array/buffer[i] |
IntIndexer |
get(long[] indices,
int[] n)
Returns
this where n = array/buffer[index(indices)] |
abstract IntIndexer |
get(long[] indices,
int[] n,
int offset,
int length)
Returns
this where n[offset:offset + length] = array/buffer[index(indices)] |
IntIndexer |
get(long i,
int[] n)
Returns
this where n = array/buffer[i] |
abstract IntIndexer |
get(long i,
int[] n,
int offset,
int length)
Returns
this where n[offset:offset + length] = array/buffer[i] |
abstract int |
get(long i,
long j)
Returns
array/buffer[i * strides[0] + j] |
IntIndexer |
get(long i,
long j,
int[] n)
Returns
this where n = array/buffer[i * strides[0] + j] |
abstract IntIndexer |
get(long i,
long j,
int[] n,
int offset,
int length)
Returns
this where n[offset:offset + length] = array/buffer[i * strides[0] + j] |
abstract int |
get(long i,
long j,
long k)
Returns
array/buffer[i * strides[0] + j * strides[1] + k] |
double |
getDouble(long... indices)
Calls
get(int...indices) and returns the value as a double. |
IntIndexer |
put(long[] indices,
int... n)
Returns
this where array/buffer[index(indices)] = n |
abstract IntIndexer |
put(long[] indices,
int n)
Returns
this where array/buffer[index(indices)] = n |
abstract IntIndexer |
put(long[] indices,
int[] n,
int offset,
int length)
Returns
this where array/buffer[index(indices)] = n[offset:offset + length] |
IntIndexer |
put(long i,
int... n)
Returns
this where array/buffer[i] = n |
abstract IntIndexer |
put(long i,
int n)
Returns
this where array/buffer[i] = n |
abstract IntIndexer |
put(long i,
int[] n,
int offset,
int length)
Returns
this where array/buffer[i] = n[offset:offset + length] |
IntIndexer |
put(long i,
long j,
int... n)
Returns
this where array/buffer[i * strides[0] + j] = n |
abstract IntIndexer |
put(long i,
long j,
int n)
Returns
this where array/buffer[i * strides[0] + j] = n |
abstract IntIndexer |
put(long i,
long j,
int[] n,
int offset,
int length)
Returns
this where array/buffer[i * strides[0] + j] = n[offset:offset + length] |
abstract IntIndexer |
put(long i,
long j,
long k,
int n)
Returns
this where array/buffer[i * strides[0] + j * strides[1] + k] = n |
IntIndexer |
putDouble(long[] indices,
double n)
Casts value to primitive type and calls
put(long[] indices, <type> value) . |
public static final int VALUE_BYTES
public static IntIndexer create(int[] array)
new IntArrayIndexer(array)
public static IntIndexer create(IntBuffer buffer)
new IntBufferIndexer(buffer)
public static IntIndexer create(IntPointer pointer)
create(pointer, { pointer.limit() - pointer.position() }, { 1 }, true)
public static IntIndexer create(int[] array, long... sizes)
new IntArrayIndexer(array, sizes)
public static IntIndexer create(IntBuffer buffer, long... sizes)
new IntBufferIndexer(buffer, sizes)
public static IntIndexer create(IntPointer pointer, long... sizes)
create(pointer, sizes, strides(sizes))
public static IntIndexer create(int[] array, long[] sizes, long[] strides)
new IntArrayIndexer(array, sizes, strides)
public static IntIndexer create(IntBuffer buffer, long[] sizes, long[] strides)
new IntBufferIndexer(buffer, sizes, strides)
public static IntIndexer create(IntPointer pointer, long[] sizes, long[] strides)
create(pointer, sizes, strides, true)
public static IntIndexer create(IntPointer pointer, long[] sizes, long[] strides, boolean direct)
pointer
- data to access via a buffer or to copy to an arraydirect
- true
to use a direct buffer, see Indexer
for detailspublic abstract int get(long i)
array/buffer[i]
public IntIndexer get(long i, int[] n)
this
where n = array/buffer[i]
public abstract IntIndexer get(long i, int[] n, int offset, int length)
this
where n[offset:offset + length] = array/buffer[i]
public abstract int get(long i, long j)
array/buffer[i * strides[0] + j]
public IntIndexer get(long i, long j, int[] n)
this
where n = array/buffer[i * strides[0] + j]
public abstract IntIndexer get(long i, long j, int[] n, int offset, int length)
this
where n[offset:offset + length] = array/buffer[i * strides[0] + j]
public abstract int get(long i, long j, long k)
array/buffer[i * strides[0] + j * strides[1] + k]
public abstract int get(long... indices)
array/buffer[index(indices)]
public IntIndexer get(long[] indices, int[] n)
this
where n = array/buffer[index(indices)]
public abstract IntIndexer get(long[] indices, int[] n, int offset, int length)
this
where n[offset:offset + length] = array/buffer[index(indices)]
public abstract IntIndexer put(long i, int n)
this
where array/buffer[i] = n
public IntIndexer put(long i, int... n)
this
where array/buffer[i] = n
public abstract IntIndexer put(long i, int[] n, int offset, int length)
this
where array/buffer[i] = n[offset:offset + length]
public abstract IntIndexer put(long i, long j, int n)
this
where array/buffer[i * strides[0] + j] = n
public IntIndexer put(long i, long j, int... n)
this
where array/buffer[i * strides[0] + j] = n
public abstract IntIndexer put(long i, long j, int[] n, int offset, int length)
this
where array/buffer[i * strides[0] + j] = n[offset:offset + length]
public abstract IntIndexer put(long i, long j, long k, int n)
this
where array/buffer[i * strides[0] + j * strides[1] + k] = n
public abstract IntIndexer put(long[] indices, int n)
this
where array/buffer[index(indices)] = n
public IntIndexer put(long[] indices, int... n)
this
where array/buffer[index(indices)] = n
public abstract IntIndexer put(long[] indices, int[] n, int offset, int length)
this
where array/buffer[index(indices)] = n[offset:offset + length]
public double getDouble(long... indices)
Indexer
get(int...indices)
and returns the value as a double.public IntIndexer putDouble(long[] indices, double n)
Indexer
put(long[] indices, <type> value)
.Copyright © 2020. All rights reserved.