Ejemplo n.º 1
0
        public static CellArray Inverse(CellArray A)
        {
            if (!CellArray.IsMatrix(A))
            {
                throw new Exception("A must be a matrix");
            }

            int A_Rows = A.Count;
            int A_Cols = CellArray.ColumnCount(A);

            if (A_Rows != A_Cols)
            {
                throw new Exception(string.Format("Matrix must be square {0}:{1}", A_Rows, A_Cols));
            }

            LUDecomposition engine = new LUDecomposition(A);

            CellArray B = CellArray.Identity(A_Rows);

            return(engine.solve(B));
        }
Ejemplo n.º 2
0
 public static CellArray Identity(int Dimension)
 {
     return(CellArray.Identity(Dimension, CellAffinity.DOUBLE));
 }