类 IndexConstant

  • 所有已实现的接口:
    java.lang.Cloneable

    public class IndexConstant
    extends Index
    An Index into an Array that always returns 0. It can have any shape, so it allows you to create a constant Array of any shape.
    作者:
    caron
    • 构造器详细资料

      • IndexConstant

        protected IndexConstant​(int rank)
      • IndexConstant

        protected IndexConstant​(int[] shape)
      • IndexConstant

        protected IndexConstant​(int[] shape,
                                int[] stride)
    • 方法详细资料

      • currentElement

        public int currentElement()
        always return 0
        覆盖:
        currentElement 在类中 Index
        返回:
        the current element's index into the 1D backing array.
      • section

        public Index section​(java.util.List<Range> ranges)
                      throws InvalidRangeException
        从类复制的说明: Index
        create a new Index based on a subsection of this one, with rank reduction if dimension length == 1.
        覆盖:
        section 在类中 Index
        参数:
        ranges - array of Ranges that specify the array subset. Must be same rank as original Array. A particular Range: 1) may be a subset; 2) may be null, meaning use entire Range.
        返回:
        new Index, with same or smaller rank as original.
        抛出:
        InvalidRangeException - if ranges dont match current shape