Added to test to determine the behavior of the BLAS and intialize the me...

...mory as needed to avoid unexpected NaN's.

This is a fix for issue gh-1569
We put it in this function because we could not put the check in the file scope. However I think it's in the wrong part of this function. It should have been in the next part, i.e. where we do the inplace version.