Пример #1
0
 private static IEnumerable<int[]> GetIndices(int[] indices, Array array, int dimension)
 {
     foreach (var index in array.Indices(dimension))
     {
         indices[dimension] = index;
         if (dimension == array.Rank - 1)
         {
             yield return indices.ToArray();
         }
         else
         {
             foreach (var nested in GetIndices(indices, array, dimension + 1))
             {
                 yield return nested;
             }
         }
     }
 }
Пример #2
0
        private void AddDiffs(
            DiffBuilder collectionBuilder,
            Array x,
            Array y,
            MemberSettings settings)
        {
            RankDiff rankDiff;
            if (TryGetRankDiff(x, y, out rankDiff))
            {
                collectionBuilder.Add(rankDiff);
                return;
            }

            foreach (var index in x.Indices())
            {
                collectionBuilder.UpdateCollectionItemDiff(x.GetValue(index), y.GetValue(index), new Index(index), settings);
            }
        }