Package org.jblas.ranges
Class IndicesRange
java.lang.Object
org.jblas.ranges.IndicesRange
- All Implemented Interfaces:
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.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIndicesRange(int[] is) Initialize from integer array.Initialize from DoubleMatrix. -
Method Summary
-
Field Details
-
indices
private int[] indices -
counter
private int counter
-
-
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:RangeInitialize Range to available indices -
length
public int length()Description copied from interface:RangeTotal number of indices. -
next
public void next()Description copied from interface:RangeIncrease counter. -
index
public int index()Description copied from interface:RangeConsecutive numbering of current index. -
value
public int value()Description copied from interface:RangeGet current index. -
hasMore
public boolean hasMore()Description copied from interface:RangeMore indices available?
-