Towel
Towel copied to clipboard
Non-numerical Gaussian elimination
After implementing Gaussian elimination I actually discovered that it's not what I needed myself. Your type might not support >, <, >=, <= operators, thus, you need an analytical presentation of determinant. For example, I'm thinking of using Matrix for my symbolic algebra, but since we can't compare expressions, I needed that:
var a = new Matrix<Entity>(2, 2);
a[0, 0] = "x + 2";
a[1, 0] = "y";
a[0, 1] = "2 ^ x";
a[1, 1] = "z";
Console.WriteLine(a.DeterminantNonNumericGaussian().Simplify());
So I implemented it. Output for the example above:
(x + 2) * z - 2 ^ x * y
However, I think it requires some work. First, #55: I added a reflection check for that operator, but @ZacharyPatten you should probably rewrite it to meet your own views on this.
Not only that, you could actually consider replacing Gaussian with NonNumericalGaussian, I just don't know how to test it better.