public void Matrix_ExtractLowerComplicatedTest() { Matrix matrixA = new Matrix(4, 4); //Set up matrix A double[] columnOneOfMatrixA = { 3, 1, 2, 5 }; double[] columnTwoOfMatrixA = { 7, 8, 1, 4 }; double[] columnThreeOfMatrixA = { 2, 4, 9, 7 }; double[] columnFourOfMatrixA = { 5, 2, 3, 1 }; matrixA.SetColumn(0, columnOneOfMatrixA); matrixA.SetColumn(1, columnTwoOfMatrixA); matrixA.SetColumn(2, columnThreeOfMatrixA); matrixA.SetColumn(3, columnFourOfMatrixA); //The LUP Decomposition //Correct L Part Matrix correctLPartOfLUPDecomposition = new Matrix(4, 4); double[] columnOneOfLMatrix = { 1, 1, 2, 5 }; double[] columnTwoOfLMatrix = { 0, 1, 1, 4 }; double[] columnThreeOfLMatrix = { 0, 0, 1, 7 }; double[] columnFourOfLMatrix = { 0, 0, 0, 1 }; correctLPartOfLUPDecomposition.SetColumn(0, columnOneOfLMatrix); correctLPartOfLUPDecomposition.SetColumn(1, columnTwoOfLMatrix); correctLPartOfLUPDecomposition.SetColumn(2, columnThreeOfLMatrix); correctLPartOfLUPDecomposition.SetColumn(3, columnFourOfLMatrix); //Calculate L Part Matrix calculatedLPartOfLUPDecomposition = matrixA.ExtractLower(); (calculatedLPartOfLUPDecomposition == correctLPartOfLUPDecomposition).Should().BeTrue(); }