/// <summary>Initializes a new instance of the <see cref="T:System.Object"></see> class.</summary>
        public ValueCoordinatesIncrementor(ref Shape shape)
        {
            if (shape.IsEmpty || shape.size == 0)
            {
                throw new InvalidOperationException("Can't construct ValueCoordinatesIncrementor with an empty shape.");
            }

            dimensions  = shape.IsScalar ? new[] { 1 } : shape.dimensions;
            Index       = new int[dimensions.Length];
            resetto     = subcursor = dimensions.Length - 1;
            endCallback = null;
        }
        public ValueCoordinatesIncrementor(int[] dims)
        {
            if (dims == null)
            {
                throw new InvalidOperationException("Can't construct ValueCoordinatesIncrementor with an empty shape.");
            }

            if (dims.Length == 0)
            {
                dims = new int[] { 1 }
            }
            ;

            dimensions  = dims;
            Index       = new int[dims.Length];
            resetto     = subcursor = dimensions.Length - 1;
            endCallback = null;
        }
 public ValueCoordinatesIncrementor(int[] dims, EndCallbackHandler endCallback) : this(dims)
 {
     this.endCallback = endCallback;
 }
 public ValueCoordinatesIncrementor(ref Shape shape, EndCallbackHandler endCallback) : this(ref shape)
 {
     this.endCallback = endCallback;
 }