Class NewAxis

  • All Implemented Interfaces:
    INDArrayIndex

    public class NewAxis
    extends Object
    implements INDArrayIndex
    New axis adds a new singular dimension to an array.
    Author:
    Adam Gibson
    • Constructor Detail

      • NewAxis

        public NewAxis()
    • 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: