public void Variables_3_matrix_solve() { VectorInterface <Double> expected = new DoubleVector(-2f / 11.0, 1f / 11.0, 5f / 11.0); GaussParallelMethod gaussMethod = new GaussParallelMethod(new Double[][] { new double[] { 3.0, 2.0, 3.0, 1.0 }, new double[] { 4.0, 4.0, 3.0, 1.0 }, new double[] { 1.0, 4.0, 4.0, 2.0 } }); gaussMethod.Solve(); VectorInterface <Double> actual = gaussMethod.GetSolution(); Assert.AreEqual(expected, actual); }
private void TestFile(string testName) { VectorInterface <Double> expected = new DoubleVector( Parser.parseVector(FileHandler.Read("tests/" + testName + "/" + testName + ".des"))); DoubleMatrix doubleMatrix = new DoubleMatrix( Parser.parseMatrix(FileHandler.Read("tests/" + testName + "/" + testName + ".A"))); doubleMatrix.UpendColumn(new DoubleVector( Parser.parseVector(FileHandler.Read("tests/" + testName + "/" + testName + ".B")))); GaussParallelMethod gaussMethod = new GaussParallelMethod(doubleMatrix); gaussMethod.Solve(); VectorInterface <Double> actual = gaussMethod.GetSolution(); Assert.AreEqual(expected, actual); }