Package org.bytedeco.javacpp.indexer
Class HalfIndexer
- java.lang.Object
-
- org.bytedeco.javacpp.indexer.Indexer
-
- org.bytedeco.javacpp.indexer.HalfIndexer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
HalfArrayIndexer,HalfBufferIndexer,HalfRawIndexer
public abstract class HalfIndexer extends Indexer
Abstract indexer for theshortprimitive type, treated as half-precision float.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHalfIndexer(long[] sizes, long[] strides)protectedHalfIndexer(Index index)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static HalfIndexercreate(short[] array)Returnsnew HalfArrayIndexer(array)static HalfIndexercreate(short[] array, long... sizes)Returnsnew HalfArrayIndexer(array, sizes)static HalfIndexercreate(short[] array, long[] sizes, long[] strides)Returnsnew HalfArrayIndexer(array, sizes, strides)static HalfIndexercreate(short[] array, Index index)Returnsnew HalfArrayIndexer(array, index)static HalfIndexercreate(java.nio.ShortBuffer buffer)Returnsnew HalfBufferIndexer(buffer)static HalfIndexercreate(java.nio.ShortBuffer buffer, long... sizes)Returnsnew HalfBufferIndexer(buffer, sizes)static HalfIndexercreate(java.nio.ShortBuffer buffer, long[] sizes, long[] strides)Returnsnew HalfBufferIndexer(buffer, sizes, strides)static HalfIndexercreate(java.nio.ShortBuffer buffer, Index index)Returnsnew HalfBufferIndexer(buffer, index)static HalfIndexercreate(ShortPointer pointer)Returnsnew HalfRawIndexer(pointer)static HalfIndexercreate(ShortPointer pointer, long... sizes)Returnsnew HalfRawIndexer(pointer, sizes)static HalfIndexercreate(ShortPointer pointer, long[] sizes, long[] strides)Returnsnew HalfRawIndexer(pointer, sizes, strides)static HalfIndexercreate(ShortPointer pointer, long[] sizes, long[] strides, boolean direct)Returnscreate(pointer, Index.create(sizes, strides), direct)static HalfIndexercreate(ShortPointer pointer, Index index)Returnsnew HalfRawIndexer(pointer, index)static HalfIndexercreate(ShortPointer pointer, Index index, boolean direct)Creates a half float indexer to access efficiently the data of a pointer.static intfromFloat(float fval)returns all higher 16 bits as 0 for all resultsabstract floatget(long i)Returnsarray/buffer[index(i)]abstract floatget(long... indices)Returnsarray/buffer[index(indices)]HalfIndexerget(long[] indices, float[] h)Returnsthiswhereh = array/buffer[index(indices)]abstract HalfIndexerget(long[] indices, float[] h, int offset, int length)Returnsthiswhereh[offset:offset + length] = array/buffer[index(indices)]HalfIndexerget(long i, float[] h)Returnsthiswhereh = array/buffer[index(i)]abstract HalfIndexerget(long i, float[] h, int offset, int length)Returnsthiswhereh[offset:offset + length] = array/buffer[index(i)]abstract floatget(long i, long j)Returnsarray/buffer[index(i, j)]HalfIndexerget(long i, long j, float[] h)Returnsthiswhereh = array/buffer[index(i, j)]abstract HalfIndexerget(long i, long j, float[] h, int offset, int length)Returnsthiswhereh[offset:offset + length] = array/buffer[index(i, j)]abstract floatget(long i, long j, long k)Returnsarray/buffer[index(i, j, k)]doublegetDouble(long... indices)Callsget(int...indices)and returns the value as a double.abstract HalfIndexerput(long[] indices, float h)Returnsthiswherearray/buffer[index(indices)] = hHalfIndexerput(long[] indices, float... h)Returnsthiswherearray/buffer[index(indices)] = habstract HalfIndexerput(long[] indices, float[] h, int offset, int length)Returnsthiswherearray/buffer[index(indices)] = h[offset:offset + length]abstract HalfIndexerput(long i, float h)Returnsthiswherearray/buffer[index(i)] = hHalfIndexerput(long i, float... h)Returnsthiswherearray/buffer[index(i)] = habstract HalfIndexerput(long i, float[] h, int offset, int length)Returnsthiswherearray/buffer[index(i)] = h[offset:offset + length]abstract HalfIndexerput(long i, long j, float h)Returnsthiswherearray/buffer[index(i, j)] = hHalfIndexerput(long i, long j, float... h)Returnsthiswherearray/buffer[index(i, j)] = habstract HalfIndexerput(long i, long j, float[] h, int offset, int length)Returnsthiswherearray/buffer[index(i, j)] = h[offset:offset + length]abstract HalfIndexerput(long i, long j, long k, float h)Returnsthiswherearray/buffer[index(i, j, k)] = hHalfIndexerputDouble(long[] indices, double h)Casts value to primitive type and callsput(long[] indices, <type> value).static floattoFloat(int hbits)ignores the higher 16 bits
-
-
-
Field Detail
-
VALUE_BYTES
public static final int VALUE_BYTES
The number of bytes used to represent a short.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HalfIndexer
protected HalfIndexer(Index index)
-
HalfIndexer
protected HalfIndexer(long[] sizes, long[] strides)
-
-
Method Detail
-
create
public static HalfIndexer create(short[] array)
Returnsnew HalfArrayIndexer(array)
-
create
public static HalfIndexer create(java.nio.ShortBuffer buffer)
Returnsnew HalfBufferIndexer(buffer)
-
create
public static HalfIndexer create(ShortPointer pointer)
Returnsnew HalfRawIndexer(pointer)
-
create
public static HalfIndexer create(short[] array, Index index)
Returnsnew HalfArrayIndexer(array, index)
-
create
public static HalfIndexer create(java.nio.ShortBuffer buffer, Index index)
Returnsnew HalfBufferIndexer(buffer, index)
-
create
public static HalfIndexer create(ShortPointer pointer, Index index)
Returnsnew HalfRawIndexer(pointer, index)
-
create
public static HalfIndexer create(short[] array, long... sizes)
Returnsnew HalfArrayIndexer(array, sizes)
-
create
public static HalfIndexer create(java.nio.ShortBuffer buffer, long... sizes)
Returnsnew HalfBufferIndexer(buffer, sizes)
-
create
public static HalfIndexer create(ShortPointer pointer, long... sizes)
Returnsnew HalfRawIndexer(pointer, sizes)
-
create
public static HalfIndexer create(short[] array, long[] sizes, long[] strides)
Returnsnew HalfArrayIndexer(array, sizes, strides)
-
create
public static HalfIndexer create(java.nio.ShortBuffer buffer, long[] sizes, long[] strides)
Returnsnew HalfBufferIndexer(buffer, sizes, strides)
-
create
public static HalfIndexer create(ShortPointer pointer, long[] sizes, long[] strides)
Returnsnew HalfRawIndexer(pointer, sizes, strides)
-
create
public static HalfIndexer create(ShortPointer pointer, long[] sizes, long[] strides, boolean direct)
Returnscreate(pointer, Index.create(sizes, strides), direct)
-
create
public static HalfIndexer create(ShortPointer pointer, Index index, boolean direct)
Creates a half float indexer to access efficiently the data of a pointer.- Parameters:
pointer- data to access via a buffer or to copy to an arrayindex- to usedirect-trueto use a direct buffer, seeIndexerfor details- Returns:
- the new half indexer backed by the raw memory interface, a buffer, or an array
-
toFloat
public static float toFloat(int hbits)
ignores the higher 16 bits
-
fromFloat
public static int fromFloat(float fval)
returns all higher 16 bits as 0 for all results
-
get
public abstract float get(long i)
Returnsarray/buffer[index(i)]
-
get
public HalfIndexer get(long i, float[] h)
Returnsthiswhereh = array/buffer[index(i)]
-
get
public abstract HalfIndexer get(long i, float[] h, int offset, int length)
Returnsthiswhereh[offset:offset + length] = array/buffer[index(i)]
-
get
public abstract float get(long i, long j)Returnsarray/buffer[index(i, j)]
-
get
public HalfIndexer get(long i, long j, float[] h)
Returnsthiswhereh = array/buffer[index(i, j)]
-
get
public abstract HalfIndexer get(long i, long j, float[] h, int offset, int length)
Returnsthiswhereh[offset:offset + length] = array/buffer[index(i, j)]
-
get
public abstract float get(long i, long j, long k)Returnsarray/buffer[index(i, j, k)]
-
get
public abstract float get(long... indices)
Returnsarray/buffer[index(indices)]
-
get
public HalfIndexer get(long[] indices, float[] h)
Returnsthiswhereh = array/buffer[index(indices)]
-
get
public abstract HalfIndexer get(long[] indices, float[] h, int offset, int length)
Returnsthiswhereh[offset:offset + length] = array/buffer[index(indices)]
-
put
public abstract HalfIndexer put(long i, float h)
Returnsthiswherearray/buffer[index(i)] = h
-
put
public HalfIndexer put(long i, float... h)
Returnsthiswherearray/buffer[index(i)] = h
-
put
public abstract HalfIndexer put(long i, float[] h, int offset, int length)
Returnsthiswherearray/buffer[index(i)] = h[offset:offset + length]
-
put
public abstract HalfIndexer put(long i, long j, float h)
Returnsthiswherearray/buffer[index(i, j)] = h
-
put
public HalfIndexer put(long i, long j, float... h)
Returnsthiswherearray/buffer[index(i, j)] = h
-
put
public abstract HalfIndexer put(long i, long j, float[] h, int offset, int length)
Returnsthiswherearray/buffer[index(i, j)] = h[offset:offset + length]
-
put
public abstract HalfIndexer put(long i, long j, long k, float h)
Returnsthiswherearray/buffer[index(i, j, k)] = h
-
put
public abstract HalfIndexer put(long[] indices, float h)
Returnsthiswherearray/buffer[index(indices)] = h
-
put
public HalfIndexer put(long[] indices, float... h)
Returnsthiswherearray/buffer[index(indices)] = h
-
put
public abstract HalfIndexer put(long[] indices, float[] h, int offset, int length)
Returnsthiswherearray/buffer[index(indices)] = h[offset:offset + length]
-
getDouble
public double getDouble(long... indices)
Description copied from class:IndexerCallsget(int...indices)and returns the value as a double.
-
putDouble
public HalfIndexer putDouble(long[] indices, double h)
Description copied from class:IndexerCasts value to primitive type and callsput(long[] indices, <type> value).
-
-