locked
Matrix.Determinant gives 0 RRS feed

  • Question

  • 			Matrix m1 = Matrix.Parse("6 0 \n 0 1");
    			Matrix m2 = Matrix.Parse("3.0 2.0 \n 1.5 3.0");
    			Matrix m3 = Matrix.Parse("0.7493 0.5074\n -0.004 -0.4204");
    			Matrix m4 = PositiveDefiniteMatrix.Identity(4);
    			Console.WriteLine(m1);
    			// expect 6
    			Console.WriteLine("m1 det: {0}", m1.Determinant());
    			// expect 6
    			Console.WriteLine("m2 det: {0}", m2.Determinant());
    			// expect -0.313
    			Console.WriteLine("m3 det: {0}", m3.Determinant());
    			Console.WriteLine("m4 det: {0}", m4.Determinant());

    I have the code which uses Infer.NET's Matrix class. I found that when I compute .Determinant(), it always gives me 0. This is either a bug or I missed something completely trivial. Also it would be nice if you implement .Inverse() of Matrix class.

    Saturday, February 21, 2015 2:58 PM

Answers

  • Sorry about that; it looks like a bug :-\ We'll fix it soon!

    -Y-

    • Marked as answer by wittawatj Sunday, February 22, 2015 7:22 PM
    Sunday, February 22, 2015 7:11 PM