matrix.h: fixed errors of input-stream usage
main.cpp: added simple test code