add test code for matrix constructor and structure methods