Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
            public CellArray getL()
            {
                CellArray L = CellArray.Matrix(m, n);

                for (int i = 0; i < m; i++)
                {
                    for (int j = 0; j < n; j++)
                    {
                        if (i > j)
                        {
                            L[i].ARRAY[j] = LU[i].ARRAY[j];
                        }
                        else if (i == j)
                        {
                            L[i].ARRAY[j] = CellValues.One(CellAffinity.DOUBLE);
                        }
                        else
                        {
                            L[i].ARRAY[j] = CellValues.Zero(CellAffinity.DOUBLE);
                        }
                    }
                }
                return(L);
            }