public void LUDecompositionDeterminantTest()
        {
            for (Int32 i = 0; i < _matrix.Length; i++)
            {
                Double determinant = LUDecomposition.ComputeDeterminant(_matrix[i]);

                Assert.AreEqual(_determinantExpected[i], determinant, 0.01);
            }
        }
Example #2
0
        public void LUDecompositionInvertTest()
        {
            for (Int32 matrixIndex = 0; matrixIndex < this.matrices.Length; matrixIndex++)
            {
                Matrix inverse = LUDecomposition.Invert(this.matrices[matrixIndex]);

                inverse.ShouldBe(this.expectedInverse[matrixIndex], 0.01);
            }

            Should.Throw <ArgumentNullException>(() => LUDecomposition.ComputeDeterminant(null));
        }
Example #3
0
        public void LUDecompositionComputeDeterminantTest()
        {
            for (Int32 matrixIndex = 0; matrixIndex < this.matrices.Length; matrixIndex++)
            {
                Double determinant = LUDecomposition.ComputeDeterminant(this.matrices[matrixIndex]);

                determinant.ShouldBe(this.expectedDeterminant[matrixIndex], 0.01);
            }

            Should.Throw <ArgumentNullException>(() => LUDecomposition.ComputeDeterminant(null));
        }