src: add checking out of range for Matrix
test: check out of range for 'set()' and 'get()'