public class HalfBufferIndexer extends HalfIndexer
ShortBuffer
, treated as half-precision float.Modifier and Type | Field and Description |
---|---|
protected ShortBuffer |
buffer
The backing buffer.
|
VALUE_BYTES
indexable, ONE_STRIDE, sizes, strides
Constructor and Description |
---|
HalfBufferIndexer(ShortBuffer buffer)
Calls
HalfBufferIndexer(buffer, { buffer.limit() }, { 1 }) . |
HalfBufferIndexer(ShortBuffer buffer,
long... sizes)
Calls
HalfBufferIndexer(buffer, sizes, strides(sizes)) . |
HalfBufferIndexer(ShortBuffer buffer,
long[] sizes,
long[] strides)
|
Modifier and Type | Method and Description |
---|---|
Buffer |
buffer()
Returns the backing buffer, or
null if none |
float |
get(long... indices)
Returns
array/buffer[index(indices)] |
float |
get(long i)
Returns
array/buffer[i] |
HalfIndexer |
get(long[] indices,
float[] h,
int offset,
int length)
Returns
this where s[offset:offset + length] = array/buffer[index(indices)] |
HalfIndexer |
get(long i,
float[] h,
int offset,
int length)
Returns
this where s[offset:offset + length] = array/buffer[i] |
float |
get(long i,
long j)
Returns
array/buffer[i * strides[0] + j] |
HalfIndexer |
get(long i,
long j,
float[] h,
int offset,
int length)
Returns
this where s[offset:offset + length] = array/buffer[i * strides[0] + j] |
float |
get(long i,
long j,
long k)
Returns
array/buffer[i * strides[0] + j * strides[1] + k] |
HalfIndexer |
put(long[] indices,
float h)
Returns
this where array/buffer[index(indices)] = s |
HalfIndexer |
put(long[] indices,
float[] h,
int offset,
int length)
Returns
this where array/buffer[index(indices)] = s[offset:offset + length] |
HalfIndexer |
put(long i,
float h)
Returns
this where array/buffer[i] = s |
HalfIndexer |
put(long i,
float[] h,
int offset,
int length)
Returns
this where array/buffer[i] = s[offset:offset + length] |
HalfIndexer |
put(long i,
long j,
float h)
Returns
this where array/buffer[i * strides[0] + j] = s |
HalfIndexer |
put(long i,
long j,
float[] h,
int offset,
int length)
Returns
this where array/buffer[i * strides[0] + j] = s[offset:offset + length] |
HalfIndexer |
put(long i,
long j,
long k,
float h)
Returns
this where array/buffer[i * strides[0] + j * strides[1] + k] = s |
void |
release()
Makes sure changes are reflected onto the backing memory and clears any references.
|
create, create, create, create, create, create, create, create, create, create, fromFloat, get, get, get, getDouble, put, put, put, putDouble, toFloat
protected ShortBuffer buffer
public HalfBufferIndexer(ShortBuffer buffer)
HalfBufferIndexer(buffer, { buffer.limit() }, { 1 })
.public HalfBufferIndexer(ShortBuffer buffer, long... sizes)
HalfBufferIndexer(buffer, sizes, strides(sizes))
.public HalfBufferIndexer(ShortBuffer buffer, long[] sizes, long[] strides)
public Buffer buffer()
Indexer
null
if nonepublic float get(long i)
HalfIndexer
array/buffer[i]
get
in class HalfIndexer
public HalfIndexer get(long i, float[] h, int offset, int length)
HalfIndexer
this
where s[offset:offset + length] = array/buffer[i]
get
in class HalfIndexer
public float get(long i, long j)
HalfIndexer
array/buffer[i * strides[0] + j]
get
in class HalfIndexer
public HalfIndexer get(long i, long j, float[] h, int offset, int length)
HalfIndexer
this
where s[offset:offset + length] = array/buffer[i * strides[0] + j]
get
in class HalfIndexer
public float get(long i, long j, long k)
HalfIndexer
array/buffer[i * strides[0] + j * strides[1] + k]
get
in class HalfIndexer
public float get(long... indices)
HalfIndexer
array/buffer[index(indices)]
get
in class HalfIndexer
public HalfIndexer get(long[] indices, float[] h, int offset, int length)
HalfIndexer
this
where s[offset:offset + length] = array/buffer[index(indices)]
get
in class HalfIndexer
public HalfIndexer put(long i, float h)
HalfIndexer
this
where array/buffer[i] = s
put
in class HalfIndexer
public HalfIndexer put(long i, float[] h, int offset, int length)
HalfIndexer
this
where array/buffer[i] = s[offset:offset + length]
put
in class HalfIndexer
public HalfIndexer put(long i, long j, float h)
HalfIndexer
this
where array/buffer[i * strides[0] + j] = s
put
in class HalfIndexer
public HalfIndexer put(long i, long j, float[] h, int offset, int length)
HalfIndexer
this
where array/buffer[i * strides[0] + j] = s[offset:offset + length]
put
in class HalfIndexer
public HalfIndexer put(long i, long j, long k, float h)
HalfIndexer
this
where array/buffer[i * strides[0] + j * strides[1] + k] = s
put
in class HalfIndexer
public HalfIndexer put(long[] indices, float h)
HalfIndexer
this
where array/buffer[index(indices)] = s
put
in class HalfIndexer
public HalfIndexer put(long[] indices, float[] h, int offset, int length)
HalfIndexer
this
where array/buffer[index(indices)] = s[offset:offset + length]
put
in class HalfIndexer
Copyright © 2020. All rights reserved.