added random number generation to linalg

@lisitsyn, @vigsterkr Pushed #2421 again, this time against the develop branch instead of feature/linalg