Added dmat generic matrix mult routine