Package org.jblas.ranges
Class IndicesRange
- java.lang.Object
-
- org.jblas.ranges.IndicesRange
-
- All Implemented Interfaces:
Range
public class IndicesRange extends java.lang.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 Summary
Constructors Constructor Description IndicesRange(int[] is)Initialize from integer array.IndicesRange(DoubleMatrix is)Initialize from DoubleMatrix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasMore()More indices available?intindex()Consecutive numbering of current index.voidinit(int l, int u)Initialize Range to available indicesintlength()Total number of indices.voidnext()Increase counter.intvalue()Get current index.
-
-
-
Constructor Detail
-
IndicesRange
public IndicesRange(int[] is)
Initialize from integer array.
-
IndicesRange
public IndicesRange(DoubleMatrix is)
Initialize from DoubleMatrix. Entries are converted to integers by truncation.
-
-
Method Detail
-
init
public void init(int l, int u)
Description copied from interface:RangeInitialize Range to available indices
-
index
public int index()
Description copied from interface:RangeConsecutive numbering of current index.
-
-