Exemplo n.º 1
0
        private static void Permute(int length, Action <int[], Symbol> action)
        {
            int[] indices = new int[length];
            for (int i = 0; i < length; i++)
            {
                indices[i] = i;
            }

            LeviCivita.Permute(indices, 0, true, action);
        }
Exemplo n.º 2
0
        static LeviCivita()
        {
            Symbol[,] array2 = ArrayUtilities.Initialize(2, 2, (i, j) => Symbol.Zero);
            LeviCivita.Permute(2, (indices, symbol) => array2[indices[0], indices[1]] = symbol);
            LeviCivita.Two = new EuclideanMatrix2((i, j) => array2[i, j]);

            Symbol[, , ,] array4 = ArrayUtilities.Initialize(4, 4, 4, 4, (i, j, k, l) => Symbol.Zero);
            LeviCivita.Permute(4, (indices, symbol) => array4[indices[0], indices[1], indices[2], indices[3]] = symbol);
            LeviCivita.Four = new Tensor4D4((i, j, k, l) => array4[i, j, k, l]);
        }