Class HalfBufferIndexer

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class HalfBufferIndexer
    extends HalfIndexer
    An indexer for a ShortBuffer, treated as half-precision float.
    • Constructor Summary

      Constructors 
      Constructor Description
      HalfBufferIndexer​(java.nio.ShortBuffer buffer)
      Calls HalfBufferIndexer(buffer, Index.create(buffer.limit())).
      HalfBufferIndexer​(java.nio.ShortBuffer buffer, long... sizes)
      Calls HalfBufferIndexer(buffer, Index.create(sizes)).
      HalfBufferIndexer​(java.nio.ShortBuffer buffer, long[] sizes, long[] strides)
      Calls HalfBufferIndexer(buffer, Index.create(sizes, strides)).
      HalfBufferIndexer​(java.nio.ShortBuffer buffer, Index index)
      Constructor to set the buffer and Indexer.index.
    • Field Detail

      • buffer

        protected java.nio.ShortBuffer buffer
        The backing buffer.
    • Constructor Detail

      • HalfBufferIndexer

        public HalfBufferIndexer​(java.nio.ShortBuffer buffer)
        Calls HalfBufferIndexer(buffer, Index.create(buffer.limit())).
      • HalfBufferIndexer

        public HalfBufferIndexer​(java.nio.ShortBuffer buffer,
                                 long... sizes)
        Calls HalfBufferIndexer(buffer, Index.create(sizes)).
      • HalfBufferIndexer

        public HalfBufferIndexer​(java.nio.ShortBuffer buffer,
                                 long[] sizes,
                                 long[] strides)
        Calls HalfBufferIndexer(buffer, Index.create(sizes, strides)).
      • HalfBufferIndexer

        public HalfBufferIndexer​(java.nio.ShortBuffer buffer,
                                 Index index)
        Constructor to set the buffer and Indexer.index.
    • Method Detail

      • buffer

        public java.nio.Buffer buffer()
        Description copied from class: Indexer
        Returns the backing buffer, or null if none
        Overrides:
        buffer in class Indexer
      • reindex

        public HalfIndexer reindex​(Index index)
        Description copied from class: Indexer
        Returns a new Indexer using the same data, but with a different Index.
        Specified by:
        reindex in class Indexer
      • get

        public float get​(long i)
        Description copied from class: HalfIndexer
        Returns array/buffer[index(i)]
        Specified by:
        get in class HalfIndexer
      • get

        public HalfIndexer get​(long i,
                               float[] h,
                               int offset,
                               int length)
        Description copied from class: HalfIndexer
        Returns this where h[offset:offset + length] = array/buffer[index(i)]
        Specified by:
        get in class HalfIndexer
      • get

        public float get​(long i,
                         long j)
        Description copied from class: HalfIndexer
        Returns array/buffer[index(i, j)]
        Specified by:
        get in class HalfIndexer
      • get

        public HalfIndexer get​(long i,
                               long j,
                               float[] h,
                               int offset,
                               int length)
        Description copied from class: HalfIndexer
        Returns this where h[offset:offset + length] = array/buffer[index(i, j)]
        Specified by:
        get in class HalfIndexer
      • get

        public float get​(long i,
                         long j,
                         long k)
        Description copied from class: HalfIndexer
        Returns array/buffer[index(i, j, k)]
        Specified by:
        get in class HalfIndexer
      • get

        public float get​(long... indices)
        Description copied from class: HalfIndexer
        Returns array/buffer[index(indices)]
        Specified by:
        get in class HalfIndexer
      • get

        public HalfIndexer get​(long[] indices,
                               float[] h,
                               int offset,
                               int length)
        Description copied from class: HalfIndexer
        Returns this where h[offset:offset + length] = array/buffer[index(indices)]
        Specified by:
        get in class HalfIndexer
      • put

        public HalfIndexer put​(long i,
                               float h)
        Description copied from class: HalfIndexer
        Returns this where array/buffer[index(i)] = h
        Specified by:
        put in class HalfIndexer
      • put

        public HalfIndexer put​(long i,
                               float[] h,
                               int offset,
                               int length)
        Description copied from class: HalfIndexer
        Returns this where array/buffer[index(i)] = h[offset:offset + length]
        Specified by:
        put in class HalfIndexer
      • put

        public HalfIndexer put​(long i,
                               long j,
                               float h)
        Description copied from class: HalfIndexer
        Returns this where array/buffer[index(i, j)] = h
        Specified by:
        put in class HalfIndexer
      • put

        public HalfIndexer put​(long i,
                               long j,
                               float[] h,
                               int offset,
                               int length)
        Description copied from class: HalfIndexer
        Returns this where array/buffer[index(i, j)] = h[offset:offset + length]
        Specified by:
        put in class HalfIndexer
      • put

        public HalfIndexer put​(long i,
                               long j,
                               long k,
                               float h)
        Description copied from class: HalfIndexer
        Returns this where array/buffer[index(i, j, k)] = h
        Specified by:
        put in class HalfIndexer
      • put

        public HalfIndexer put​(long[] indices,
                               float h)
        Description copied from class: HalfIndexer
        Returns this where array/buffer[index(indices)] = h
        Specified by:
        put in class HalfIndexer
      • put

        public HalfIndexer put​(long[] indices,
                               float[] h,
                               int offset,
                               int length)
        Description copied from class: HalfIndexer
        Returns this where array/buffer[index(indices)] = h[offset:offset + length]
        Specified by:
        put in class HalfIndexer
      • release

        public void release()
        Description copied from class: Indexer
        Makes sure changes are reflected onto the backing memory and clears any references.
        Specified by:
        release in class Indexer