uwhpsc-2016 / homework2

Homework #2
0 stars 3 forks source link

test_jacobi and test_gauss_seidel Accuracy Issue #50

Closed boygao1992 closed 8 years ago

boygao1992 commented 8 years ago

When "n" is small, like 4, the result is good. But when I choose an "n" greater than 10, the test result is like the following:

FAIL: test_gauss_seidel (main.TestSolver)

Traceback (most recent call last): File "test_homework2.py", line 133, in test_gauss_seidel self.assertLess(error, 1e-8) AssertionError: 1.510871028108888e-08 not less than 1e-08

I used "do while" loop for iterations in both my jacobi and gauss seidel methods, which may be an issue. So I tried "while" loop but it didn't help solving this issue. Could you take a look at my code and give me some hints about it?

boygao1992 commented 8 years ago

I see the problem. The terminal condition and my test are inconsistent. The result should be within a interval of 2_epsilon not 1_epsilon.