/// <summary> /// The function returns the determinent of a Matrix object as Fraction /// </summary> public static Fraction Determinent(MATRIX matrix) { Fraction det = new Fraction(0); if (matrix.Rows != matrix.Cols) { throw new MatrixException("Determinent of a non-square matrix doesn't exist"); } if (matrix.Rows == 1) { return(matrix[0, 0]); } for (int j = 0; j < matrix.Cols; j++) { det += (matrix[0, j] * Determinent(MATRIX.Minor(matrix, 0, j)) * (int)System.Math.Pow(-1, 0 + j)); } return(det); }