Пример #1
0
        public static CellArray Identity(int Dimension, CellAffinity Type)
        {
            if (!CellAffinityHelper.IsNumeric(Type))
            {
                return(new CellArray());
            }

            Cell zero = CellValues.Zero(Type);
            Cell one  = CellValues.One(Type);

            CellArray x = CellArray.Matrix(Dimension, Dimension);

            for (int i = 0; i < Dimension; i++)
            {
                for (int j = 0; j < Dimension; j++)
                {
                    x[i].ARRAY[j] = (i == j ? one : zero);
                }
            }

            return(x);
        }