2019.11.21
def buildSystemNaive(im_shape):
A = np.identity(np.prod(im_shape))
#complete the values of A
### YOUR CODE HERE
height = im_shape[1]
width = im_shape[0]
size = height * width
for i in range(size):
A[i][i] = 4
if i - width >= 0:
A[i][i-width] = -1
if i + width < size:
A[i][i+width] = -1
if i%width - 1 >= 0:
A[i][i - 1] = -1
if i%width +1 < width:
A[i][i + 1] = -1
### END YOUR CODE
return A