@Matt, <br><br> thanks but this is just general matrix multiplication , not the dot product multiplication's for a matrix<br><br><br>@Jed Brown<br><br>I am trying to draw random numbers from a complex multivariate mixture distribution needed for a monte carlo simulation. X:= mu + Lambda.* W + gamma.*sqrt(W) , where they are all NxN dense matrices of equal size where N ranges from 100,000 to 2,000,000. I need to do the dot product multiplication and addition for every part of this distribution. Would petsc be the right tool for this or should i just stick to C and mpi. I've already used many petsc functions that have made life much eaiser<br>