Esempio n. 1
0
 static public void GetStartingIndex(this IArrayDefinition array, int[] indexes)
 {
     for (int i = 0; i < array.Rank; i++)
     {
         indexes[i] = array.GetLowerBound(i);
     }
 }
Esempio n. 2
0
        static public bool MoveIndex(this IArrayDefinition array, ref int x, int dimension)
        {
            x++;
            if (x < array.GetOutOfBound(dimension))
            {
                return(true);
            }

            x = array.GetLowerBound(dimension);
            return(false);
        }
Esempio n. 3
0
        static public bool ContainsIndex(this IArrayDefinition array, params int[] indexes)
        {
            for (int r = 0; r < array.Rank; r++)
            {
                if (indexes[r] < array.GetLowerBound(r) || indexes[r] > array.GetUpperBound(r))
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 4
0
        static public bool MoveIndex(this IArrayDefinition array, int[] indexes)
        {
            indexes[array.Rank - 1]++;

            for (int r = array.Rank - 1; r >= 0; r--)
            {
                if (indexes[r] < array.GetOutOfBound(r))
                {
                    break;
                }

                if (r - 1 < 0)
                {
                    return(false);
                }

                indexes[r] = array.GetLowerBound(r);
                indexes[r - 1]++;
            }

            return(true);
        }
Esempio n. 5
0
 static public void GetStartingIndex(this IArrayDefinition array, out int i)
 {
     i = array.GetLowerBound(0);
 }
Esempio n. 6
0
 static public int GetOutOfBound(this IArrayDefinition array, int dimension)
 {
     return(array.GetLowerBound(dimension) + array.GetLength(dimension));
 }