Class IndicesRange

java.lang.Object
org.jblas.ranges.IndicesRange
All Implemented Interfaces:
Range

public class IndicesRange extends Object implements Range
Range which varies over pre-specified indices. For example,
     int[] indices = new int[] { 1, 1, 2, 3, 5, 8, 13 };
     Range r = new IndicesRange(indices);
ranges over the first few Fibonacci numbers.
  • Constructor Details

    • IndicesRange

      public IndicesRange(int[] is)
      Initialize from integer array.
    • IndicesRange

      Initialize from DoubleMatrix. Entries are converted to integers by truncation.
  • Method Details

    • init

      public void init(int l, int u)
      Description copied from interface: Range
      Initialize Range to available indices
      Specified by:
      init in interface Range
    • length

      public int length()
      Description copied from interface: Range
      Total number of indices.
      Specified by:
      length in interface Range
    • next

      public void next()
      Description copied from interface: Range
      Increase counter.
      Specified by:
      next in interface Range
    • index

      public int index()
      Description copied from interface: Range
      Consecutive numbering of current index.
      Specified by:
      index in interface Range
    • value

      public int value()
      Description copied from interface: Range
      Get current index.
      Specified by:
      value in interface Range
    • hasMore

      public boolean hasMore()
      Description copied from interface: Range
      More indices available?
      Specified by:
      hasMore in interface Range