picasso250
2014-11-24 19:11:23 +08:00
For a given point [i,j], we could write down it's expression,
v[i,j] = (v[i-1,j] + v[i+1, j] + v[i, j-1] + v[i, j+1]) / 4.
If all the 4 points' value is known, we could calculate the value of v[i,j]. This condition is the base condition, 3x3 matrix.
In general, we could write down (m-2)*(n-2) equations about all unknown points, hence we could solve that system of linear equations.
For us coder, we just need to make another matrix and solve it.