Class 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 Detail

      • PointIndex

        public PointIndex​(long point)
        Parameters:
        point -
    • Method Detail

      • end

        public long end()
        Description copied from interface: INDArrayIndex
        The ending for this index
        Specified by:
        end in interface INDArrayIndex
        Returns:
      • offset

        public long offset()
        Description copied from interface: INDArrayIndex
        The start of this index
        Specified by:
        offset in interface INDArrayIndex
        Returns:
      • length

        public long length()
        Description copied from interface: INDArrayIndex
        The total length of this index (end - start)
        Specified by:
        length in interface INDArrayIndex
        Returns:
      • stride

        public long stride()
        Description copied from interface: INDArrayIndex
        The stride for the index (most of the time will be 1)
        Specified by:
        stride in interface INDArrayIndex
        Returns:
      • isInterval

        public boolean isInterval()
        Description copied from interface: INDArrayIndex
        Returns true if the index is an interval
        Specified by:
        isInterval in interface INDArrayIndex
        Returns:
      • init

        public void init​(INDArray arr,
                         long begin,
                         int dimension)
        Description copied from interface: INDArrayIndex
        Init the index wrt the dimension and the given nd array
        Specified by:
        init in interface INDArrayIndex
        Parameters:
        arr - the array to initialize on
        begin - the beginning index
        dimension - the dimension to initialize on
      • init

        public void init​(INDArray arr,
                         int dimension)
        Description copied from interface: INDArrayIndex
        Init the index wrt the dimension and the given nd array
        Specified by:
        init in interface INDArrayIndex
        Parameters:
        arr - the array to initialize on
        dimension - the dimension to initialize on
      • init

        public void init​(long begin,
                         long end,
                         long max)
        Specified by:
        init in interface INDArrayIndex
      • init

        public void init​(long begin,
                         long end)
        Description copied from interface: INDArrayIndex
        Initialize based on the specified begin and end
        Specified by:
        init in interface INDArrayIndex
      • initialized

        public boolean initialized()
        Description copied from interface: INDArrayIndex
        Returns 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:
        initialized in interface INDArrayIndex
        Returns: