add matrix for math, and matrix for AI. unit test pass.