Package org.nd4j.linalg.indexing
Class PointIndex
- java.lang.Object
-
- org.nd4j.linalg.indexing.PointIndex
-
- All Implemented Interfaces:
INDArrayIndex
public class PointIndex extends Object implements INDArrayIndex
A point index is used for pulling something like a specific row from an array. A view will be created based on the point at the given dimension. Negative indices can also be specified allowing for dynamic resolution of dimensions/coordinates at runtime.- Author:
- Adam Gibson
-
-
Constructor Summary
Constructors Constructor Description PointIndex(long point)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description INDArrayIndexdup()Deep copy of thisINDArrayIndexlongend()The ending for this indexvoidinit(long begin, long end)Initialize based on the specified begin and endvoidinit(long begin, long end, long max)voidinit(INDArray arr, int dimension)Init the index wrt the dimension and the given nd arrayvoidinit(INDArray arr, long begin, int dimension)Init the index wrt the dimension and the given nd arraybooleaninitialized()Returns true if this index has been initialized.booleanisInterval()Returns true if the index is an intervallonglength()The total length of this index (end - start)longoffset()The start of this indexvoidreverse()Reverse the indexeslongstride()The stride for the index (most of the time will be 1)StringtoString()
-
-
-
Method Detail
-
end
public long end()
Description copied from interface:INDArrayIndexThe ending for this index- Specified by:
endin interfaceINDArrayIndex- Returns:
-
offset
public long offset()
Description copied from interface:INDArrayIndexThe start of this index- Specified by:
offsetin interfaceINDArrayIndex- Returns:
-
length
public long length()
Description copied from interface:INDArrayIndexThe total length of this index (end - start)- Specified by:
lengthin interfaceINDArrayIndex- Returns:
-
stride
public long stride()
Description copied from interface:INDArrayIndexThe stride for the index (most of the time will be 1)- Specified by:
stridein interfaceINDArrayIndex- Returns:
-
reverse
public void reverse()
Description copied from interface:INDArrayIndexReverse the indexes- Specified by:
reversein interfaceINDArrayIndex
-
isInterval
public boolean isInterval()
Description copied from interface:INDArrayIndexReturns true if the index is an interval- Specified by:
isIntervalin interfaceINDArrayIndex- Returns:
-
init
public void init(INDArray arr, long begin, int dimension)
Description copied from interface:INDArrayIndexInit the index wrt the dimension and the given nd array- Specified by:
initin interfaceINDArrayIndex- Parameters:
arr- the array to initialize onbegin- the beginning indexdimension- the dimension to initialize on
-
init
public void init(INDArray arr, int dimension)
Description copied from interface:INDArrayIndexInit the index wrt the dimension and the given nd array- Specified by:
initin interfaceINDArrayIndex- Parameters:
arr- the array to initialize ondimension- the dimension to initialize on
-
init
public void init(long begin, long end, long max)- Specified by:
initin interfaceINDArrayIndex
-
init
public void init(long begin, long end)Description copied from interface:INDArrayIndexInitialize based on the specified begin and end- Specified by:
initin interfaceINDArrayIndex
-
initialized
public boolean initialized()
Description copied from interface:INDArrayIndexReturns true if this index has been initialized. Sometimes indices may define certain constraints such as negative indices that may not be resolved until use.INDArray.get(INDArrayIndex...)will check for when an index is initialized and if not initialize it upon use.- Specified by:
initializedin interfaceINDArrayIndex- Returns:
-
dup
public INDArrayIndex dup()
Description copied from interface:INDArrayIndexDeep copy of thisINDArrayIndex- Specified by:
dupin interfaceINDArrayIndex- Returns:
-
-