public abstract class HalfIndexer extends Indexer
short primitive type, treated as half-precision float.| Modifier and Type | Field and Description |
|---|---|
static int |
VALUE_BYTES
The number of bytes used to represent a short.
|
| Modifier | Constructor and Description |
|---|---|
protected |
HalfIndexer(Index index) |
protected |
HalfIndexer(long[] sizes,
long[] strides) |
| Modifier and Type | Method and Description |
|---|---|
static HalfIndexer |
create(short[] array)
Returns
new HalfArrayIndexer(array) |
static HalfIndexer |
create(short[] array,
Index index)
Returns
new HalfArrayIndexer(array, index) |
static HalfIndexer |
create(short[] array,
long... sizes)
Returns
new HalfArrayIndexer(array, sizes) |
static HalfIndexer |
create(short[] array,
long[] sizes,
long[] strides)
Returns
new HalfArrayIndexer(array, sizes, strides) |
static HalfIndexer |
create(ShortBuffer buffer)
Returns
new HalfBufferIndexer(buffer) |
static HalfIndexer |
create(ShortBuffer buffer,
Index index)
Returns
new HalfBufferIndexer(buffer, index) |
static HalfIndexer |
create(ShortBuffer buffer,
long... sizes)
Returns
new HalfBufferIndexer(buffer, sizes) |
static HalfIndexer |
create(ShortBuffer buffer,
long[] sizes,
long[] strides)
Returns
new HalfBufferIndexer(buffer, sizes, strides) |
static HalfIndexer |
create(ShortPointer pointer)
Returns
new HalfRawIndexer(pointer) |
static HalfIndexer |
create(ShortPointer pointer,
Index index)
Returns
new HalfRawIndexer(pointer, index) |
static HalfIndexer |
create(ShortPointer pointer,
Index index,
boolean direct)
Creates a half float indexer to access efficiently the data of a pointer.
|
static HalfIndexer |
create(ShortPointer pointer,
long... sizes)
Returns
new HalfRawIndexer(pointer, sizes) |
static HalfIndexer |
create(ShortPointer pointer,
long[] sizes,
long[] strides)
Returns
new HalfRawIndexer(pointer, sizes, strides) |
static HalfIndexer |
create(ShortPointer pointer,
long[] sizes,
long[] strides,
boolean direct)
Returns
create(pointer, Index.create(sizes, strides), direct) |
static int |
fromFloat(float fval)
returns all higher 16 bits as 0 for all results
|
abstract float |
get(long... indices)
Returns
array/buffer[index(indices)] |
abstract float |
get(long i)
Returns
array/buffer[index(i)] |
HalfIndexer |
get(long[] indices,
float[] h)
Returns
this where h = array/buffer[index(indices)] |
abstract HalfIndexer |
get(long[] indices,
float[] h,
int offset,
int length)
Returns
this where h[offset:offset + length] = array/buffer[index(indices)] |
HalfIndexer |
get(long i,
float[] h)
Returns
this where h = array/buffer[index(i)] |
abstract HalfIndexer |
get(long i,
float[] h,
int offset,
int length)
Returns
this where h[offset:offset + length] = array/buffer[index(i)] |
abstract float |
get(long i,
long j)
Returns
array/buffer[index(i, j)] |
HalfIndexer |
get(long i,
long j,
float[] h)
Returns
this where h = array/buffer[index(i, j)] |
abstract HalfIndexer |
get(long i,
long j,
float[] h,
int offset,
int length)
Returns
this where h[offset:offset + length] = array/buffer[index(i, j)] |
abstract float |
get(long i,
long j,
long k)
Returns
array/buffer[index(i, j, k)] |
double |
getDouble(long... indices)
Calls
get(int...indices) and returns the value as a double. |
HalfIndexer |
put(long[] indices,
float... h)
Returns
this where array/buffer[index(indices)] = h |
abstract HalfIndexer |
put(long[] indices,
float h)
Returns
this where array/buffer[index(indices)] = h |
abstract HalfIndexer |
put(long[] indices,
float[] h,
int offset,
int length)
Returns
this where array/buffer[index(indices)] = h[offset:offset + length] |
HalfIndexer |
put(long i,
float... h)
Returns
this where array/buffer[index(i)] = h |
abstract HalfIndexer |
put(long i,
float h)
Returns
this where array/buffer[index(i)] = h |
abstract HalfIndexer |
put(long i,
float[] h,
int offset,
int length)
Returns
this where array/buffer[index(i)] = h[offset:offset + length] |
HalfIndexer |
put(long i,
long j,
float... h)
Returns
this where array/buffer[index(i, j)] = h |
abstract HalfIndexer |
put(long i,
long j,
float h)
Returns
this where array/buffer[index(i, j)] = h |
abstract HalfIndexer |
put(long i,
long j,
float[] h,
int offset,
int length)
Returns
this where array/buffer[index(i, j)] = h[offset:offset + length] |
abstract HalfIndexer |
put(long i,
long j,
long k,
float h)
Returns
this where array/buffer[index(i, j, k)] = h |
HalfIndexer |
putDouble(long[] indices,
double h)
Casts value to primitive type and calls
put(long[] indices, <type> value). |
static float |
toFloat(int hbits)
ignores the higher 16 bits
|
public static final int VALUE_BYTES
protected HalfIndexer(Index index)
protected HalfIndexer(long[] sizes,
long[] strides)
public static HalfIndexer create(short[] array)
new HalfArrayIndexer(array)public static HalfIndexer create(ShortBuffer buffer)
new HalfBufferIndexer(buffer)public static HalfIndexer create(ShortPointer pointer)
new HalfRawIndexer(pointer)public static HalfIndexer create(short[] array, Index index)
new HalfArrayIndexer(array, index)public static HalfIndexer create(ShortBuffer buffer, Index index)
new HalfBufferIndexer(buffer, index)public static HalfIndexer create(ShortPointer pointer, Index index)
new HalfRawIndexer(pointer, index)public static HalfIndexer create(short[] array, long... sizes)
new HalfArrayIndexer(array, sizes)public static HalfIndexer create(ShortBuffer buffer, long... sizes)
new HalfBufferIndexer(buffer, sizes)public static HalfIndexer create(ShortPointer pointer, long... sizes)
new HalfRawIndexer(pointer, sizes)public static HalfIndexer create(short[] array, long[] sizes, long[] strides)
new HalfArrayIndexer(array, sizes, strides)public static HalfIndexer create(ShortBuffer buffer, long[] sizes, long[] strides)
new HalfBufferIndexer(buffer, sizes, strides)public static HalfIndexer create(ShortPointer pointer, long[] sizes, long[] strides)
new HalfRawIndexer(pointer, sizes, strides)public static HalfIndexer create(ShortPointer pointer, long[] sizes, long[] strides, boolean direct)
create(pointer, Index.create(sizes, strides), direct)public static HalfIndexer create(ShortPointer pointer, Index index, boolean direct)
pointer - data to access via a buffer or to copy to an arrayindex - to usedirect - true to use a direct buffer, see Indexer for detailspublic static float toFloat(int hbits)
public static int fromFloat(float fval)
public abstract float get(long i)
array/buffer[index(i)]public HalfIndexer get(long i, float[] h)
this where h = array/buffer[index(i)]public abstract HalfIndexer get(long i, float[] h, int offset, int length)
this where h[offset:offset + length] = array/buffer[index(i)]public abstract float get(long i,
long j)
array/buffer[index(i, j)]public HalfIndexer get(long i, long j, float[] h)
this where h = array/buffer[index(i, j)]public abstract HalfIndexer get(long i, long j, float[] h, int offset, int length)
this where h[offset:offset + length] = array/buffer[index(i, j)]public abstract float get(long i,
long j,
long k)
array/buffer[index(i, j, k)]public abstract float get(long... indices)
array/buffer[index(indices)]public HalfIndexer get(long[] indices, float[] h)
this where h = array/buffer[index(indices)]public abstract HalfIndexer get(long[] indices, float[] h, int offset, int length)
this where h[offset:offset + length] = array/buffer[index(indices)]public abstract HalfIndexer put(long i, float h)
this where array/buffer[index(i)] = hpublic HalfIndexer put(long i, float... h)
this where array/buffer[index(i)] = hpublic abstract HalfIndexer put(long i, float[] h, int offset, int length)
this where array/buffer[index(i)] = h[offset:offset + length]public abstract HalfIndexer put(long i, long j, float h)
this where array/buffer[index(i, j)] = hpublic HalfIndexer put(long i, long j, float... h)
this where array/buffer[index(i, j)] = hpublic abstract HalfIndexer put(long i, long j, float[] h, int offset, int length)
this where array/buffer[index(i, j)] = h[offset:offset + length]public abstract HalfIndexer put(long i, long j, long k, float h)
this where array/buffer[index(i, j, k)] = hpublic abstract HalfIndexer put(long[] indices, float h)
this where array/buffer[index(indices)] = hpublic HalfIndexer put(long[] indices, float... h)
this where array/buffer[index(indices)] = hpublic abstract HalfIndexer put(long[] indices, float[] h, int offset, int length)
this where array/buffer[index(indices)] = h[offset:offset + length]public double getDouble(long... indices)
Indexerget(int...indices) and returns the value as a double.public HalfIndexer putDouble(long[] indices, double h)
Indexerput(long[] indices, <type> value).Copyright © 2022. All rights reserved.