put matrix in vector class