matrix.h v3.1

refer README.pdf