commit prim matrix