support MatRand and MathSrand