public class IntervalIndex extends Object implements INDArrayIndex
Modifier and Type | Field and Description |
---|---|
protected long |
begin |
protected long |
end |
protected boolean |
inclusive |
protected long |
index |
protected long |
length |
protected long |
stride |
Constructor and Description |
---|
IntervalIndex(boolean inclusive,
long stride) |
Modifier and Type | Method and Description |
---|---|
long |
end()
The ending for this index
|
boolean |
equals(Object o) |
int |
hashCode() |
void |
init(INDArray arr,
int dimension)
Init the index wrt
the dimension and the given nd array
|
void |
init(INDArray arr,
long begin,
int dimension)
Init the index wrt
the dimension and the given nd array
|
void |
init(long begin,
long end)
Initiailize based on the specified begin and end
|
void |
init(long begin,
long end,
long max) |
boolean |
isInterval()
Returns true
if the index is an interval
|
long |
length()
The total length of this index (end - start)
|
long |
offset()
The start of this index
|
void |
reverse()
Reverse the indexes
|
long |
stride()
The stride for the index (most of the time will be 1)
|
String |
toString() |
protected long begin
protected long end
protected boolean inclusive
protected long stride
protected long index
protected long length
public IntervalIndex(boolean inclusive, long stride)
inclusive
- whether to include the last numberstride
- the stride for the intervalpublic long end()
INDArrayIndex
end
in interface INDArrayIndex
public long offset()
INDArrayIndex
offset
in interface INDArrayIndex
public long length()
INDArrayIndex
length
in interface INDArrayIndex
public long stride()
INDArrayIndex
stride
in interface INDArrayIndex
public void reverse()
INDArrayIndex
reverse
in interface INDArrayIndex
public boolean isInterval()
INDArrayIndex
isInterval
in interface INDArrayIndex
public void init(INDArray arr, long begin, int dimension)
INDArrayIndex
init
in interface INDArrayIndex
arr
- the array to initialize onbegin
- the beginning indexdimension
- the dimension to initialize onpublic void init(INDArray arr, int dimension)
INDArrayIndex
init
in interface INDArrayIndex
arr
- the array to initialize ondimension
- the dimension to initialize onpublic void init(long begin, long end, long max)
init
in interface INDArrayIndex
public void init(long begin, long end)
INDArrayIndex
init
in interface INDArrayIndex
Copyright © 2020. All rights reserved.