1 | initial version |
If you use Visual Studio 2010 or higher, you can use the PPL-library. You then have access to parallel loops, in this case you should take a look at parallel_for. That way, you can parallelize the initialization of the matrix. If you don't use VS, there are other libraries around that provide parallelization (Intel TBB etc.)
If you use parallelization, you have to change the way you set the matrix values, since it's random in which order the elements get accessed.