public void LUDecomposition_4x4Matrix_InvertDeterminantCalculated() { var d = new LU(); d.Calculate(_m); Assert.AreEqual(Math.Round(1 / 347.505, 5), Math.Round(d.InvertDeterminant(), 5)); }
public void LUDecomposition_4x4Matrix_DeterminantCalculated() { var d = new LU(); d.Calculate(_m); Assert.AreEqual(347.505, Math.Round(d.Determinant(), 3)); }
public void LUDecomposition_4x4Matrix_4x4Decomposition() { var d = new LU(); d.Calculate(_m); Assert.AreEqual(1214.831, Math.Round(d.Decomposition[0, 0], 3)); Assert.AreEqual(1234.175, Math.Round(d.Decomposition[0, 1], 3)); Assert.AreEqual(1195.806, Math.Round(d.Decomposition[0, 2], 3)); Assert.AreEqual(1216.329, Math.Round(d.Decomposition[0, 3], 3)); Assert.AreEqual(0.985, Math.Round(d.Decomposition[1, 0], 3)); Assert.AreEqual(-0.981, Math.Round(d.Decomposition[1, 1], 3)); Assert.AreEqual(-0.378, Math.Round(d.Decomposition[1, 2], 3)); Assert.AreEqual(-1.120, Math.Round(d.Decomposition[1, 3], 3)); Assert.AreEqual(0.969, Math.Round(d.Decomposition[2, 0], 3)); Assert.AreEqual(0.593, Math.Round(d.Decomposition[2, 1], 3)); Assert.AreEqual(0.780, Math.Round(d.Decomposition[2, 2], 3)); Assert.AreEqual(0.632, Math.Round(d.Decomposition[2, 3], 3)); Assert.AreEqual(0.985, Math.Round(d.Decomposition[3, 0], 3)); Assert.AreEqual(-0.158, Math.Round(d.Decomposition[3, 1], 3)); Assert.AreEqual(0.810, Math.Round(d.Decomposition[3, 2], 3)); Assert.AreEqual(0.374, Math.Round(d.Decomposition[3, 3], 3)); }