Class DoubleArrayIndexer

All Implemented Interfaces:
AutoCloseable

public class DoubleArrayIndexer extends DoubleIndexer
An indexer for a double[] array.
  • Field Details

    • array

      protected double[] array
      The backing array.
  • Constructor Details

    • DoubleArrayIndexer

      public DoubleArrayIndexer(double[] array)
      Calls DoubleArrayIndexer(array, Index.create(array.length)).
    • DoubleArrayIndexer

      public DoubleArrayIndexer(double[] array, long... sizes)
      Calls DoubleArrayIndexer(array, Index.create(sizes)).
    • DoubleArrayIndexer

      public DoubleArrayIndexer(double[] array, long[] sizes, long[] strides)
      Calls DoubleArrayIndexer(array, Index.create(sizes, strides)).
    • DoubleArrayIndexer

      public DoubleArrayIndexer(double[] array, Index index)
      Constructor to set the array and Indexer.index.
  • Method Details

    • array

      public double[] array()
      Description copied from class: Indexer
      Returns the backing array, or null if none
      Overrides:
      array in class Indexer
    • reindex

      public DoubleIndexer 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 double get(long i)
      Description copied from class: DoubleIndexer
      Returns array/buffer[index(i)]
      Specified by:
      get in class DoubleIndexer
    • get

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

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

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

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

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

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

      public DoubleIndexer put(long i, double d)
      Description copied from class: DoubleIndexer
      Returns this where array/buffer[index(i)] = d
      Specified by:
      put in class DoubleIndexer
    • put

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

      public DoubleIndexer put(long i, long j, double d)
      Description copied from class: DoubleIndexer
      Returns this where array/buffer[index(i, j)] = d
      Specified by:
      put in class DoubleIndexer
    • put

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

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

      public DoubleIndexer put(long[] indices, double d)
      Description copied from class: DoubleIndexer
      Returns this where array/buffer[index(indices)] = d
      Specified by:
      put in class DoubleIndexer
    • put

      public DoubleIndexer put(long[] indices, double[] d, int offset, int length)
      Description copied from class: DoubleIndexer
      Returns this where array/buffer[index(indices)] = d[offset:offset + length]
      Specified by:
      put in class DoubleIndexer
    • 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