/// <summary> /// Inversion matrix method LU /// </summary> public static double[,] Inversion(double[,] matrix) { if (Decomposition(matrix) != (null, null)) { (double[,] L, double[,] U) = Decomposition(matrix); double[,] E = InversionLUP.GenerateE(matrix.GetLength(0)); return(DecisionSystem(matrix, E, L, U)); }
/// <summary> /// Inversion matrix method edging /// </summary> public static double[,] Inversion(double[,] matrix) { double[,] P = InversionLUP.GetMatrixPermutation(matrix); matrix = MatrixOp.Multiply(P, matrix); double[,] matrixInversion = new double[, ] { { 1 / matrix[matrix.GetLength(0) - 1, matrix.GetLength(0) - 1] } }; for (int i = 2; i < matrix.GetLength(0) + 1; i++) { matrixInversion = InversionMiniMatrix(matrix, i, matrixInversion); } return(MatrixOp.Multiply(matrixInversion, P)); }